--- procps-3.2.7.orig/debian/watch +++ procps-3.2.7/debian/watch @@ -0,0 +1,6 @@ +# Example watch control file for uscan +# Rename this file to "watch" and then you can run the "uscan" command +# to check for upstream updates and more. +# Site Directory Pattern Version Script +version=3 +http://procps.sourceforge.net/download.html procps-(.*)\.tar\.gz --- procps-3.2.7.orig/debian/NEWS +++ procps-3.2.7/debian/NEWS @@ -0,0 +1,8 @@ +procps (1:3.2.7-10) unstable; urgency=low + + * In this version I revert a long-standing (since potato I think) patch that + incorrectly changed the time output for w for its Idle, PCPU and JCPU + times. The patch should of only changed the times if the -o flag was + used, instead of all the time. This is now fixed. + + -- Craig Small Fri, 09 Jan 2009 16:41:02 +1100 --- procps-3.2.7.orig/debian/libproc-dev.README +++ procps-3.2.7/debian/libproc-dev.README @@ -0,0 +1,12 @@ +README for libproc-dev +====================== + +This README is for people who want to use the libraries for their own +programs. If you just want to use procps tools you don't need to use this +and you can probably remove libproc-dev too. + +It is generally a bad idea to dynamically link to libproc. The API changes +a fair bit and I cannot guarantee that it will stay the same between minor +versions (though it will stay the same between Debian versions). I've now +re-included the libproc.a file so use that. + --- procps-3.2.7.orig/debian/control +++ procps-3.2.7/debian/control @@ -0,0 +1,35 @@ +Source: procps +Section: admin +Priority: required +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Craig Small +Build-Depends: debhelper (>= 7), libncurses5-dev, make (>= 3.78.1-8), dpatch +Standards-Version: 3.8.0 + +Package: procps +Architecture: any +Depends: ${shlibs:Depends}, lsb-base (>= 3.0-10) +Provides: watch +Conflicts: watch, libproc-dev (<< 1:1.2.6-2), w-bassman (<< 1.0-3), procps-nonfree, pgrep (<< 3.3-5) +Replaces: watch, bsdutils (<< 2.9x-1) +Recommends: psmisc +Description: /proc file system utilities + These are utilities to browse the /proc filesystem, which is not a real file + system but a way for the kernel to provide information about the status of + entries in its process table. (e.g. running, stopped or "zombie") + Both command line and full screen utilities are provided. Ncurses is needed + for the full screen utilities. More information can be found at procps + website http://procps.sf.net/ + . + This package includes the following utilities: top, uptime, tload, + free, vmstat, watch, skill, pmap, pgrep, slabtop and pwdx. + +Package: libproc-dev +Architecture: any +Section: libdevel +Priority: optional +Depends: libc6-dev, procps (= ${binary:Version}) +Description: library for accessing process information from /proc + These are the header files for libproc. Some packages using libproc + to access process information from /proc need these to compile. + --- procps-3.2.7.orig/debian/menu +++ procps-3.2.7/debian/menu @@ -0,0 +1,4 @@ +?package(procps):needs="text" section="Applications/System/Monitoring" \ + title="Top" \ + description="Display Linux tasks" \ + command="/usr/bin/top" --- procps-3.2.7.orig/debian/init +++ procps-3.2.7/debian/init @@ -0,0 +1,48 @@ +#! /bin/sh +# /etc/init.d/procps: Set kernel variables from /etc/sysctl.conf +# +# written by Elrond + +### BEGIN INIT INFO +# Provides: procps +# Required-Start: mountkernfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Configure kernel parameters at boottime +# Description: Loads kernel parameters that are specified in /etc/sysctl.conf +### END INIT INFO + + +# Check for existance of the default file and exit if not there, +# Closes #52839 for the boot-floppy people +[ -r /etc/default/rcS ] || exit 0 +. /etc/default/rcS +. /lib/lsb/init-functions + +PATH=/sbin:$PATH +which sysctl > /dev/null || exit 0 + + +case "$1" in + start|restart|force-reload) + quiet="-q" + if [ "$VERBOSE" = "yes" ]; then + quiet="" + fi + for file in /etc/sysctl.conf /etc/sysctl.d/*.conf ; do + if [ -r "$file" ] ; then + log_action_begin_msg "Setting kernel variables ($file)" + sysctl $quiet -p "$file" + log_action_end_msg $? + fi + done + ;; + stop) + ;; + *) + echo "Usage: /etc/init.d/procps {start|stop|restart|force-reload}" >&2 + exit 3 + ;; +esac +exit 0 --- procps-3.2.7.orig/debian/postrm +++ procps-3.2.7/debian/postrm @@ -0,0 +1,91 @@ +#!/bin/sh +# postrm script for procps +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Undo removal of a no-longer used conffile +undo_rm_conffile() +{ + CONFFILE="$1" + + if [ ! -e "$CONFFILE" ]; then + if [ -e "$CONFFILE".dpkg-bak ]; then + echo "Restoring modified conffile $CONFFILE" + mv -f "$CONFFILE".dpkg-bak "$CONFFILE" + elif [ -e "$CONFFILE".dpkg-obsolete ]; then + mv -f "$CONFFILE".dpkg-obsolete "$CONFFILE" + fi + fi +} + +# Finish removal of a no-longer used conffile +finish_rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-bak ]; then + rm -f "$CONFFILE".dpkg-bak + fi +} + +restoreoldconffile() +{ + v=$1 + f=/etc/init.d/procps + c=1:3.2.7-5 + [ ! -e "$f" ] && return + dpkg --compare-versions "$1" ge "$c" || return + mv "$f" "$f.sh" +} + +case "$1" in + abort-install|abort-upgrade) + restoreoldconffile + + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then + undo_rm_conffile /etc/sysctl.d/10-tcp-timestamps-workaround.conf + fi + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then + undo_rm_conffile /etc/sysctl.d/10-process-security.conf + fi + ;; + purge) + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then + finish_rm_conffile /etc/sysctl.d/10-tcp-timestamps-workaround.conf + fi + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then + finish_rm_conffile /etc/sysctl.d/10-process-security.conf + fi + ;; + remove|upgrade|failed-upgrade|disappear) + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- procps-3.2.7.orig/debian/README.Debian +++ procps-3.2.7/debian/README.Debian @@ -0,0 +1,22 @@ +README for Debian package of procps +=================================== + +XConsole gone +------------- + XConsole and other X-based programs have been finally removed. Look in + the x packages for their equivalents. + +pgrep +----- +pgrep is a new program, using the Unix standard name for something that +greps for processes. If you are looking for Perl compatible regular +expression grep, it is called pcregrep. + +forks +----- +Procps upstream is forked. This one comes from procps.sf.net I'm really +not interested when the others have new versions so please don't bug me about +it. However if you see something neat in the others and would like it in +the Debian one, report a *wishlist* level bug about it. + + Craig Small --- procps-3.2.7.orig/debian/changelog +++ procps-3.2.7/debian/changelog @@ -0,0 +1,1331 @@ +procps (1:3.2.7-11ubuntu3) jaunty; urgency=medium + + * Relaxed 100hz tick timer detection in procps. Initially this was + reported as a problem in an image running in qemu, but it has also been + found in some native imx51 and i386 systems booting on slow devices also. + (LP: #364656). + + -- David Sugar Wed, 05 Aug 2009 11:21:23 -0400 + +procps (1:3.2.7-11ubuntu2) jaunty; urgency=low + + * debian/{preinst,postinst,postrm}: drop sysctl.d/10-process-security.conf + now that the defaults are carried in the kernel configurations + (LP: #344955). + + -- Kees Cook Wed, 18 Mar 2009 14:52:48 -0700 + +procps (1:3.2.7-11ubuntu1) jaunty; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/{postinst,rules}: init script to priority 17, remove on upgrade. + - debian/rules (Ubuntu-specific): + - install sysctl files from new sysctl.d directory. + - append debian/sysctl.d/*.conf.$DEB_HOST_ARCH to 10-arch-specific.conf + - debian/sysctl.d (Ubuntu-specific): + - 10-console-messages.conf: stop low-level kernel messages on console. + - 10-network-security.conf: enable "rp_filter" by default. + - 10-process-security.conf: block lower 64k allocations to protect + kernel from NULL deref attacks. + - 10-keyboard.conf.powerpc: mouse button emulation on PowerPC. + * procps-3.2.7/debian/{preinst,postinst,postrm}: drop + sysctl.d/10-tcp-timestamps-workaround.conf again now that we have a + fixed kernel, and make sure it gets removed on upgrade to this version + (LP: #264019, duplicated from 1:3.2.7-9ubuntu2.1). + * debian/sysctl.d/10-network-security.conf: enable SYN-flood protection + by default (LP: #57091). + + -- Kees Cook Fri, 06 Feb 2009 08:22:44 -0800 + +procps (1:3.2.7-11) unstable; urgency=low + + * Reversed rules line so init.d is in everything except kfreebsd + Closes: #511513 + + -- Craig Small Mon, 12 Jan 2009 08:48:53 +1100 + +procps (1:3.2.7-10) unstable; urgency=low + + * PATH_MAX problem fixed Closes: #496274 + * NOHZ patch appilied Closes: #495882 + * Added some extra comments about sysctl Closes: #495884 + * init script respects VERBOSE Closes: #495885 + * More ps sorting Closes: #508435 + * ps displays cgroups Closes: #469669 + * Added cross build support Closes: #451812 + * Added Hilko's fix for sysctl Closes: #511082 + * Applied Mortys watch exec patch, thankyou!! + Closes: #225549, #155227, #420377, #481679,#410967 + * top UID length now increased to 5 Closes: #426782 + * init script not installed for kFreeBSD Closes: #502729 + * Fixed kernel.maps_protect entry in sysctl.conf Closes: #494655 + * D flag documented in man page Closes: #495987 + * w uses locale for centi-seconds Closes: #252575 + * Corrected w-bassman patch which made ALL times change and documented + what the times mean in w.1 Closes: #414906 + * Changed dh_clean -k to dh_prep + * Updated to debhelper 7 + * Replaced may in kill.1 Closes: #375739 + * Added precision wait time to watch Closes: #183486 + * top exits if it cannot read /proc Closes: #378695 + * Adjusted top.1 as CODE DATA fields were incorrect Closes: 267873 + * Added --errexit flag on watch to exit on command error Closes: + #183346 + + -- Craig Small Sun, 11 Jan 2009 12:29:42 +1100 + +procps (1:3.2.7-9.1) unstable; urgency=low + + * NMU + * Removes spuirous debug printf() that breaks other packages + (Closes: #511082) + + -- Hilko Bengen Wed, 07 Jan 2009 13:47:37 +0100 + +procps (1:3.2.7-9ubuntu3) jaunty; urgency=low + + * debian/sysctl.d/10-process-security.conf: + - Remove kernel.maps_protect option, it has been dropped in 2.6.28 + kernel tree: http://lkml.org/lkml/2008/10/9/399 (LP: #304117). + + -- Luca Falavigna Mon, 01 Dec 2008 20:17:15 +0100 + +procps (1:3.2.7-9ubuntu2) intrepid; urgency=low + + * Add debian/sysctl.d/10-tcp-timestamps-workaround.conf to disable TCP + timestamping, since its implementation in the 2.6.27 kernel in Ubuntu + 8.10 causes problems with certain routers (LP: #264019). + + -- Colin Watson Mon, 27 Oct 2008 10:47:21 +0000 + +procps (1:3.2.7-9ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/{postinst,rules}: init script to priority 17, remove on upgrade. + - debian/patches/60_top_nohz: fix idle report when running NOHZ (debian + bug #495882). + - debian/init: respect $VERBOSE setting (debian bug #495885). + - debian/sysctl.conf: recommend against tcp_syncookies since it blocks + tcp window scaling (debian bug #495884). + - debian/control: Maintainer field update. + * debian/sysctl.d: move all Ubuntu-specific sysctl settings: + - 10-console-messages.conf: stop low-level kernel messages on console. + - 10-network-security.conf: enable "rp_filter" by default. + - 10-process-security.conf: + - block lower 64k allocations to protect kernel from NULL deref attacks. + - enable /proc/$pid/maps protection. + - 10-keyboard.conf.powerpc: Mouse button emulation. + - 30-inotify-limits.conf: moved to "tracker" package for increasing + inotify watches to 524,388 for tracker. + * debian/rules: + - install sysctl files from new sysctl.d directory. + - append debian/sysctl.d/*.conf.$DEB_HOST_ARCH to 10-arch-specific.conf + * debian/sysctl.conf: add comment drawing attention to sysctl.d directory + (debian bug #495884). + + -- Kees Cook Sun, 17 Aug 2008 06:25:40 -0700 + +procps (1:3.2.7-9) unstable; urgency=low + + * Reverse order of sysctl file reads + * Added sys.kernel.maps_protect option to syctl.conf Closes: #446466 + * Add up 7 cpu numbers Closes: 460331 + * Top closes when it gets EOF Closes: #458986, #416976 + * Fixed -a option processing Closes: #408608 + * Added German man page for w Closes: #390225 + * Updated to standards version 3.8.0 + + -- Craig Small Sun, 10 Aug 2008 11:49:12 +1000 + +procps (1:3.2.7-8ubuntu2) intrepid; urgency=low + + * Remove rcS.d/S17procps.sh on upgrade, eliminating Ubuntu cruft. + + -- Adam Conrad Mon, 30 Jun 2008 15:46:16 -0600 + +procps (1:3.2.7-8ubuntu1) intrepid; urgency=low + + * Merge from debian unstable, remaining changes (LP: #242976): + - debian/{postinst,rules}: Place init script at priority 17. + - debian/patches/60_top_nohz: fix idle report when running NOHZ. + - debian/sysctl.conf: enable /proc/$pid/maps protection. + - debian/rules: allow for arch-specific sysctl.conf settings. + (append debian/sysctl.conf.$DEB_HOST_ARCH, if it exists, to sysctl.conf) + - debian/sysctl.conf.powerpc: Mouse button emulation. + - debian/init: respect $VERBOSE setting. + - debian/control: Maintainer field update. + - debian/sysctl.conf: stop low-level kernel messages to console + (this was formerly not documented in the changelog) + - debian/sysctl.conf: increase inotify watches to 524,388 for tracker. + - debian/sysctl.conf: enable "rp_filter" by default. + - debian/sysctl.conf: comment added about tcp_syncookies setting disabling + TCP Window Scaling + - debian/sysctl.conf: enable lower 64k protection to stop NULL deref + attacks. + + -- Lars Wirzenius Wed, 25 Jun 2008 22:36:33 +0300 + +procps (1:3.2.7-8) unstable; urgency=low + + * Quote $file in init script and remove weird *.conf directory + Closes: #474710, #474725 + + -- Craig Small Tue, 08 Apr 2008 08:34:54 +1000 + +procps (1:3.2.7-7) unstable; urgency=low + + * Actually apply top patch Closes: #351065 + * Irix mode + thread CPU fix Closes: #459890 + * kill/skill prints error message Closes: #468363 + * rule file changes for nostrip and passing CFLAGS Closes: #468656 + * Duplicate ignore broadcast in sysctl.conf removed Closes: #474406 + * Added IPv6 lines for redirects and source route to sysctl.conf + Closes: #474431 + * Fixed IPv6 forwarding line in sysctl.conf Closes: #469557, #464150 + * pri field explained in ps.1 Closes: #465761 + * sysct.conf now has TCP/IP instead of TCP.IP again Closes: #463652, + #463824 + * Added /etc/sysctl.d/ directory for other packages Closes: #370351 + * Added bug presubj for kill Closes: #409118 + * no-heading option documented in ps.1 Closes: #431081 + + -- Craig Small Mon, 07 Apr 2008 10:01:05 +1000 + +procps (1:3.2.7-6) unstable; urgency=low + + * Remove procps.sh version check Closes: #459680 + * Added Paolo's patch to fix highlighting cutoffs Closes: #351065 + * Cleaned up sysctl.conf Closes: #447076, #446466, #446989, #446990, #465449 + * Removed missing option from sysctl.conf Closes: #460665 + * Changed to standard version 3.7.3 + + -- Craig Small Fri, 01 Feb 2008 23:01:28 +1100 + +procps (1:3.2.7-5ubuntu2) hardy; urgency=low + + * debian/sysctl.conf: + - enable "rp_filter" by default (LP: #201952). + - clean up duplicated entries, adjust documentation about syn cookies. + + -- Kees Cook Thu, 13 Mar 2008 14:13:26 -0700 + +procps (1:3.2.7-5ubuntu1) hardy; urgency=low + + * Merge from debian unstable, remaining changes: + - debian/{postinst,rules}: Place init script at priority 17. + - debian/patches/60_top_nohz: fix idle report when running NOHZ. + - debian/sysctl.conf: enable /proc/$pid/maps protection. + - debian/rules: allow for arch-specific sysctl.conf settings. + - debian/sysctl.conf.powerpc: Mouse button emulation. + - debian/init: respect $VERBOSE setting. + - debian/control: Maintainer field update. + - debian/sysctl.conf: increase inotify watches to 524,388 for tracker. + * debian/sysctl.conf: enable lower 64k protection to stop NULL deref attacks. + + -- Kees Cook Wed, 24 Oct 2007 10:41:23 -0700 + +procps (1:3.2.7-5) unstable; urgency=low + + * Added headers into vmstat Closes: #436805 + * totpages and pslab removed from vmstat.8 Closes: #436806 + * Conditionally move procps.sh to procps init script Closes: #437063 + * SEE ALSO section in pgrep.1 uses .BR Closes: #437678 + * ipv4 forwarding example fixed Closes: #418804 + * top minimum time adjusted Closes: #298347 + * pgrep.1 patch doesnt add the -c option again Closes: #385621, #431884 + * Fixed minor typo in free.1 Closes: #435540 + * top.1 mentions st steal time Closes: #402478 + * Added some security-enhancing options to sysctl.conf Closes: #324593 + * Updated date on patched man pages as this is their new issue date + + -- Craig Small Thu, 04 Oct 2007 22:44:25 +1000 + +procps (1:3.2.7-4.1) unstable; urgency=low + + * armel porter NMU. + * DEB_HOST_GNU_SYSTEM != linux-gnu on armel. Check DEB_HOST_ARCH_OS instead. + Closes: #437613 + + -- Joey Hess Mon, 10 Sep 2007 15:55:08 -0400 + +procps (1:3.2.7-4) unstable; urgency=low + + * top exits with correct code Closes: #341272, #354255 + * sysctl malloc extended by 1 Closes: #423704 + * sysctl.conf has both rp_filter lines Closes: #389395 + * Updated top.c resize patch Closes: #256376 + * Changed /proc message Closes: #292721 + * Correct return code for pgrep Closes: #413383 + * Correct return code for vmstat Closes: #425492 + * init script lost it .sh we dont need it Closes: #343620 + * Adjusted the shlibs so they are more relaxed. + + -- Craig Small Wed, 08 Aug 2007 20:27:55 +1000 + +procps (1:3.2.7-3ubuntu7) hardy; urgency=low + + * No particular need for the maximum inotify instances to be that high, + leave them at the default -- otherwise you'll exhaust file descriptors + first. + + -- Scott James Remnant Sat, 10 Nov 2007 10:47:44 -0500 + +procps (1:3.2.7-3ubuntu6) hardy; urgency=low + + * Increase maximum inotify instances to 1,024 and watches to 524,388 - + since tracker is in our default install, we need a lot more. + + -- Scott James Remnant Sun, 28 Oct 2007 10:34:10 -0400 + +procps (1:3.2.7-3ubuntu5) gutsy; urgency=low + + * Test for DEB_HOST_ARCH_OS=linux instead of DEB_HOST_GNU_SYSTEM=linux-gnu + as the lpia DEB_HOST_GNU_SYSTEM is linux-gnulp instead, which breaks. + + -- Adam Conrad Tue, 31 Jul 2007 17:03:28 +1000 + +procps (1:3.2.7-3ubuntu4) gutsy; urgency=low + + * Fix idle counter display with NOHZ kernels. + With massive SMP machines and NOHZ, it is possible that the CPU is really + idle.. so idle that top will show 0.0% in idle. This one liner will make + sure to report that the CPU is 100.0% in idle and produce a less confusing + output. + + -- Fabio M. Di Nitto Fri, 20 Jul 2007 12:53:29 +0200 + +procps (1:3.2.7-3ubuntu3) gutsy; urgency=low + + * debian/sysctl.conf: enable /proc/$pid/maps protection, new in 2.6.22. + + -- Kees Cook Thu, 10 May 2007 00:39:48 -0700 + +procps (1:3.2.7-3ubuntu2) feisty; urgency=low + + * Rebuild for changes in the amd64 toolchain. + * Set Ubuntu maintainer address. + + -- Matthias Klose Mon, 5 Mar 2007 01:24:55 +0000 + +procps (1:3.2.7-3ubuntu1) feisty; urgency=low + + * Merge from Debian unstable. Remaining Ubuntu changes: + - debian/rules: Add debian/sysctl.conf.$(DEB_HOST_ARCH) to default + sysctl.conf file. + - debian/sysctl.conf.powerpc: Mouse button emulation. + - debian/postinst, debian/rules: Place init script at priority 17. + - debian/sysctl.conf: Set kernel.printk to default values 4 4 1 7 to avoid + cluttering consoles on powerpc. + - debian/procps.sh: Respect $VERBOSE. + + -- Martin Pitt Fri, 3 Nov 2006 18:28:41 +0100 + +procps (1:3.2.7-3) unstable; urgency=low + + * Changed init script dependencies Closes: #386637, #386341 + * init script uses lsb logging Closes: #384920 + + -- Craig Small Wed, 13 Sep 2006 11:27:56 +1000 + +procps (1:3.2.7-2ubuntu3) edgy; urgency=low + + * debian/sysctl.conf: Explicitly set the kernel.printk sysctl to '4 4 1 7' + to stop kernel log spewage to consoles on powerpc. On i386/amd64 this is + the default printk setting anyway, thus does not change any default, but + with the powerpc kernels the default is '0 0 0 0'. + + -- Martin Pitt Fri, 8 Sep 2006 15:44:45 +0200 + +procps (1:3.2.7-2ubuntu2) edgy; urgency=low + + * debian/rules: Re-add debian/sysctl.conf.$(DEB_HOST_ARCH) addition to the + default sysctl.conf file (apparently this got dropped in the last merge). + This repairs mouse F11/F12 mouse button emulation on powerpc. + + -- Martin Pitt Wed, 16 Aug 2006 15:19:51 +0200 + +procps (1:3.2.7-2ubuntu1) edgy; urgency=low + + [ Ubuntu Merge-o-Matic ] + * Merge from debian unstable. + + -- Scott James Remnant Fri, 30 Jun 2006 01:33:16 +0100 + +procps (1:3.2.7-2) unstable; urgency=medium + + * pgrep c option patch works correctly Closes: #375791 + * Made urgency medium as pgrep -c segfaults pgrep + + -- Craig Small Wed, 28 Jun 2006 22:28:02 +1000 + +procps (1:3.2.7-1ubuntu1) edgy; urgency=low + + [ Ongoing Merge Process ] + * Merge from debian unstable. + + [ Scott James Remnant ] + * Drop postinst migration now that dapper is released. + + -- Scott James Remnant Wed, 28 Jun 2006 23:31:06 +0100 + +procps (1:3.2.7-1) unstable; urgency=low + + * New upstream release + * Fixed nroff typo in man page Closes: #326517 + * pgrep/pkill: fix some realloc-related crashes Closes: #353894 + * Using debhelper compat level 5 + * Bumped standards versiob to 3.7.2 + * watch difference check uses 8 bit char Closes: #207103 + * Updated watch file location Closes: #354242 + * Cleaned up init.d script Closes: #294765, #338970 + * init.d script has those lsb dependency thingies Closes: #335320 + * Removed .rej file out of gnu_kbsd patch Closes: #362875 + * Removed duplicate -N option out of sysctl.8 Closes: #364894 + * Explain load average in uptime.1 Closes: #365019 + * Removed empty directories Closes: #359146 + * IPv4/6 sysctl.conf examples fixed Closes: #341087 + * sysctl.8 has optional filename for -p Closes: #297144 + * top.1 Now has Bold enable=off as default Closes: #293981 + * free.1 documents the -g (gigabytes) flag CloseS: #286900 + * Cleanup man pages Closes: #282168 + * added rollbacks to maint scripts Closes: #374456 + * Updated gnu kbsd patch Closes: #349982 + * Added list of commands to description Closes: #354686 + * Changed copyright, most of it is under LGPL now + * Move to admin section to stop dinstaller complaining at me + * Actually apply cpu state top.1 patch Closes: #351998 + * sysctl.conf doesn't mention /etc/network/options Closes: #339788 + * sysctl.conf uses default instead of all for network stuff as networking + rc is done later Closes: #337019 + + -- Craig Small Mon, 26 Jun 2006 08:16:19 +1000 + +procps (1:3.2.6-2.2) unstable; urgency=low + + * NMU + * Document the copyright of the emacs bindings bit of pgrep in + debian/copyright (Closes: #362876) + + -- Don Armstrong Sat, 22 Apr 2006 07:45:25 -0700 + +procps (1:3.2.6-2.1) unstable; urgency=low + + * NMU + * Use a temporary file for the output of the check_gcc test to avoid + removing /dev/null on failure. Thanks to Niv Altivanik for the patch. + (Closes: #336710) + + -- Don Armstrong Sun, 19 Feb 2006 15:48:35 -0800 + +procps (1:3.2.6-2ubuntu4) dapper; urgency=low + + * Move init script to S17 so it gets run after all modules have probably + been loaded, otherwise many sysctls will probably not be set. Users + will have to worry about disabling things a different way (which this + has never been useful for anyway). + + -- Scott James Remnant Mon, 23 Jan 2006 15:34:03 +0000 + +procps (1:3.2.6-2ubuntu3) dapper; urgency=low + + * Undo rename of init script, I was overzealously reading my notes and + it's not necessary. Keeps the Debian diff smaller. + + -- Scott James Remnant Wed, 4 Jan 2006 10:41:49 +0000 + +procps (1:3.2.6-2ubuntu2) dapper; urgency=low + + * Move init script from S30 to S05 so it can apply options before + modules are loaded; especially important for disabling networking + features, etc. + * Rename init script to avoid confusion, and avoid problems using exit + in *.sh scripts. + + -- Scott James Remnant Thu, 15 Dec 2005 01:44:51 +0000 + +procps (1:3.2.6-2ubuntu1) dapper; urgency=low + + * resync with debian, merged by hand + + -- Michael Vogt Fri, 25 Nov 2005 17:50:43 +0100 + +procps (1:3.2.6-2) unstable; urgency=low + + * properly patched for kfreebsd Closes: #290719 + + -- Craig Small Wed, 2 Nov 2005 13:58:22 +1100 + +procps (1:3.2.6-1) unstable; urgency=low + + * New upstream source + * ps: man page more detailed Closes: #334682 + * spelling fixes Closes: #300333, #334684, #334685 + * top: crash on resize fixed -- thanks Michal Maruska Closes: #320289 + * vmstat: -p handles /dev/ and does not overflow Closes: #319523, #330969 + * CPU states in top man page Closes: #312157, #228899 + * w.bassman finally patched into w Closes: #45937 + * w uses COLUMNS if ioctl fails, eg with pipe Closes: #252799 + * GNU/kFreeBSD Support Closes: #290719 + * Variables that are set are specified on init Closes: #330464 + * sysctl.conf has netbase examples Closes: #331192 + * sysctl.conf example has way to stop console logging Closes: #292834 + + -- Craig Small Mon, 31 Oct 2005 18:49:07 +1100 + +procps (1:3.2.5-1ubuntu1) breezy; urgency=low + + * Resynchronise with Debian. + + -- Adam Conrad Thu, 21 Apr 2005 08:50:56 +0000 + +procps (1:3.2.5-1) unstable; urgency=low + + * New upstream release + display problem on 64-bit systems fixed Closes: #287947 + top: help and version message on stdout, with exit(0) Closes: #283541 + ps: SIGTSTP and SIGTTOU shouldn't print bug email address Closes: #246123 + slabtop: fix overflow on huge NUMA boxes Closes: #264640 + slabtop: accept any slabinfo 2.x format Closes: #287691 + + -- Craig Small Thu, 27 Jan 2005 11:07:46 +1100 + +procps (1:3.2.4-1ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + + -- Colin Watson Wed, 8 Dec 2004 10:45:17 +0100 + +procps (1:3.2.4-1) unstable; urgency=low + + * New upstream release + ps: tolerate SubDomain security module CONTEXT/LABEL data Closes: #277401 + * init.d doesnt print done when not verbose Closes: #264431 + * init.d script runs sysctl with -q for quiet Closes: #277111 + * sysctl.conf has warning about network overiding varables Closes: #275291 + + -- Craig Small Wed, 17 Nov 2004 12:56:21 +1100 + +procps (1:3.2.3-1ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + + -- Scott James Remnant Wed, 27 Oct 2004 14:28:50 +0100 + +procps (1:3.2.3-1) unstable; urgency=low + + * New upstream release + + -- Craig Small Wed, 18 Aug 2004 13:24:19 +1000 + +procps (1:3.2.2-2) unstable; urgency=low + + * Missed one more lib64 override. Works on os390 now + + -- Craig Small Fri, 30 Jul 2004 21:48:47 +1000 + +procps (1:3.2.2-1) unstable; urgency=low + + * New upstream release + pgrep: man page SEE ALSO updated Closes: #226817 + top: try to handle terminals lacking rmam and smam Closes: #235003 + * Upstream now has quiet patch so removing dpatch for it. + + -- Craig Small Wed, 28 Jul 2004 16:25:34 +1000 + +procps (1:3.2.1-2ubuntu3) warty; urgency=low + + * On Macs, emulate the middle and right mouse buttons with F11 and F12 + respectively (closes: Warty #1187). + + -- Colin Watson Tue, 14 Sep 2004 20:11:25 +0100 + +procps (1:3.2.1-2ubuntu2) warty; urgency=low + + * Added versioned depend on lsb-base + + -- Nathaniel McCallum Fri, 3 Sep 2004 15:15:09 -0400 + +procps (1:3.2.1-2ubuntu1) warty; urgency=low + + * debian/procps.sh: pretty initscript + + -- Nathaniel McCallum Fri, 3 Sep 2004 11:59:29 -0400 + +procps (1:3.2.1-2) unstable; urgency=low + + * Fix Makefile patch so it works with newer patch packages + Closes: #242574 + * Changed the way SHARED is used in Makefiles + * init script looks nicer when setting multiple variables Closes: #241721 + + -- Craig Small Tue, 13 Apr 2004 07:59:25 +1000 + +procps (1:3.2.1-1) unstable; urgency=low + + * New upstream release + * Changed init script output Closes: #238567 + * menu item has text quoted + + -- Craig Small Thu, 1 Apr 2004 22:53:37 +1000 + +procps (1:3.2.0-1) unstable; urgency=low + + * New upstream release + test scripts build on ia-64 + Fix terminal when ^Z top Closes: #228822 + slabtop added Closes: #226778 + * postinst checks for symlink and not file to remove Closes: #234306 + + + -- Craig Small Wed, 25 Feb 2004 16:35:03 +1100 + +procps (1:3.1.15-3) unstable; urgency=low + + * Removed entry in Makefile for /libc64 so sparc64 builds + + -- Craig Small Tue, 17 Feb 2004 11:01:24 +1100 + +procps (1:3.1.15-2) unstable; urgency=low + + * Removed offending test directory Closes: #227933 + + -- Craig Small Tue, 20 Jan 2004 10:20:44 +1100 + +procps (1:3.1.15-1) unstable; urgency=low + + * Now uses dpatch to handle the various patches + * New upstream release + - Supports SELINUX flags for kernel v2.6 Closes: #193648 + - Hide kernel PID bug Closes: #217278, #219730, #217525, #224470 + - Fixed top auto-margins problem Closes: #217559 + * Fix top manual page Closes: #225089 + * Patch so SELINUX flags work in v2.4 kernels + * Extra +s in ps.1 removed Closes: #218220 + * Added patch so sysctl has quiet -q flag Closes: #189100 + + -- Craig Small Fri, 26 Dec 2003 18:02:59 +1100 + +procps (1:3.1.14-1) unstable; urgency=low + + * New upstream release + + -- Craig Small Wed, 22 Oct 2003 11:59:53 +1000 + +procps (1:3.1.13-1) unstable; urgency=low + + * New upstream release + + -- Craig Small Wed, 24 Sep 2003 16:10:42 +1000 + +procps (1:3.1.12-1) unstable; urgency=low + + * New upstream release + ps: $PS_FORMAT works properly Closes: #201575 + man page: /var/run/utmp, not /etc/utmp Closes: #206583 + required flags moved out of CFLAGS Closes: #205429 + + + -- Craig Small Sat, 13 Sep 2003 21:11:09 +1000 + +procps (1:3.1.11-2) unstable; urgency=low + + * Made shlibs have a specific version Closes: #199118 + * libproc.a is back in libproc-dev, use it + * Added README to libproc-dev for people who use the library + + -- Craig Small Wed, 20 Aug 2003 15:31:59 +1000 + +procps (1:3.1.11-1) unstable; urgency=low + + * 3.1.11 New upstream version + - handle GPLONLY_ symbols Closes: #143549, #188374 + * freeproc now defined Closes: #189047 + * warning in readproc.c fixed Closes: #197346 + * Removed optarg and optind defines Closes: #197343 + * Fixed saved_start_time warning Closes: #197342 + + -- Craig Small Thu, 24 Jul 2003 17:02:36 +1000 + +procps (1:3.1.9-1) unstable; urgency=low + + * New upstream source + * memory sizes fixed for 64-bit w/ gcc 3.x Closes: #194376, #191933 + * Doesn't segfault if /proc not mounted Closes: #172735 + * No warning in top about memory key Closes: #188271 + * More info in kill man page Closes: #182414 + * Document the different oO options Closes: #169301 + * Updated stabndards version to 3.5.9 + * Changed disk to backing storage Closes: #175925 + + -- Craig Small Mon, 2 Jun 2003 02:31:03 +1000 + +procps (1:3.1.8-1) unstable; urgency=low + + * New upstream release + watch man page fixed, Closes #182246 + * Changed section for libproc-dev + + -- Craig Small Tue, 1 Apr 2003 10:19:05 +1000 + +procps (1:3.1.6-1) unstable; urgency=low + + * New upstream release + - watch has --no-title option Closes: #179862 + - ps -C can compare very long names Closes: #178127 + * Fixed descriptions in manual pages Closes: #179046 + * w wont crash if /proc unreadable Closes: #169398 + + -- Craig Small Sat, 22 Feb 2003 21:33:45 +1100 + +procps (1:3.1.5-1) unstable; urgency=low + + * New upstream version + - watch don't drop empty lines Closes: #171005 + - top has old sort keys Closes: #167249 + - now count Inact_laundry as needed Closes: #172163 + + -- Craig Small Mon, 6 Jan 2003 13:49:32 +1100 + +procps (1:3.1.3-1) unstable; urgency=low + + * New upstream source + + -- Craig Small Fri, 13 Dec 2002 16:16:36 +1100 + +procps (1:3.1.1-1) unstable; urgency=low + + * New upstream source + - vmstats reports memort counts Closes: #169774 + + -- Craig Small Wed, 4 Dec 2002 15:57:13 +1100 + +procps (1:3.1.0-1) unstable; urgency=low + + * New upstream version + - vmstat displays IO-wait time instead of bogus "w" + - when IO-wait hidden, count as idle, not as sys + - pmap command added (like Sun has) + * Manual pages cleaned up Closes: #165970, #164481 + + -- Craig Small Mon, 11 Nov 2002 12:03:46 +1100 + +procps (1:3.0.5-1) unstable; urgency=low + + * New upstream version + - top tolerates super-wide displays Closes: #165497 + - ELF note warning gone for some kernels Closes: #165900 + - Fix ps and top man pages a bit, dropped bugs severity. + + -- Craig Small Tue, 29 Oct 2002 22:04:36 +1100 + +procps (1:3.0.4-1) unstable; urgency=low + + * New upstream version + - ELF note warning removed Closes: #165093, #165343 + - top works for most TERM= settings Closes: #164864, #164956 + * w has FROM column again by default Closes: #165252 + * debhelper dependency version fixed Closes: #165083 + * ps.1 looks a bit better now Closes: #16448 + + -- Craig Small Mon, 21 Oct 2002 08:30:04 +1000 + +procps (1:3.0.3-1) unstable; urgency=low + + * New upstream version + - w works with KOI8 locale Closes: #153043 + - fix top for non-SMP 2.2.xx and 2.0.xx Closes: #164231 + - negative idle time fixed Closes: #126260 + - sysctl handles new vlan interface Closes: #140386 + - vmstat documentation update Closes: #157935, #155684 + - "skill -n blah blah blah" lets you test options Closes: #158630 + - fixed ps --sort crash Closes: #164226 + - vmstat compiles with latest gcc-3.x Closes: #164348 + - bad (int*) cast in top removed Closes: #164468 + - Support new/improved statistics interfaces in 2.5 /proc Closes: #164013 + - top defaults to old layout and sort by pid Closes: #164277 + - rant moved out of top.1 man page Closes: #164520 + - top runs much faster Closes: #87779 + + -- Craig Small Sat, 12 Oct 2002 21:44:23 +1000 + +procps (1:3.0.0-2) unstable; urgency=low + + * Fixed pkill and skill, auto* is so broken. Closes: #163940, #163944 + * Moved libproc.so.3 into /lib as it's needed early Closes: #163981,#163899 + + -- Craig Small Thu, 10 Oct 2002 07:19:45 +1000 + +procps (1:3.0.0-1) unstable; urgency=low + + * New upstream source Closes: #163698 + - top has SMP Closes: #162316, #62282, #94896, #98277, #117040, #117735 + - SELINUX support Closes: #142892 + - top defaults to signal 15 to kill pids with Closes: #72158 + - 64-bit time reduces the overflow problem Closes: #82382, #155908 + - "w" program better at determining what a user is doing + Closes: #88758, 115529 + - oldps is gone Closes: #101917 + - Handles /proc/tty/drivers Closes: #108654, #154046 + - Supports scanf where locale uses , for decimal point Closes: #126873 + - uptime --help now calls itself uptime Closes: #128880 + - ps faster Closes: #147731 + - top calculates screen better Closes: #162296 + - top allows sorts by pid or swapped memory Closes: #79868, #159446 + - support for s/390 Closes: #126295 + - statm buffer size increased Closes: #145085 + - new top has no typos Closes: #148918 + - new top can handle lots of tasks Closes: #70900 + * Fixed init.d file so it follows policy Closes: #121945 + + -- Craig Small Tue, 8 Oct 2002 12:29:45 +1000 + +procps (1:2.0.7-10) unstable; urgency=low + + * Fixes ps crash when system.map is exact multiple of 1024 + Thankyou Colin for the patch! Closes: #109237, #142292 + + -- Craig Small Fri, 12 Apr 2002 21:02:04 +1000 + +procps (1:2.0.7-9) unstable; urgency=low + + * Sanity checking for Number of CPU Closes: #127561, #122617 + This will keep the m68k and ARM boys happy. + * uptime usage fixed Closes: #138351 + * kill man page NAME updated Closes: #119400 + * Better explanation for load average in uptime(1) Closes: #140902 + * utmp in correct location in w(1) Closes: #115725 + + -- Craig Small Mon, 8 Apr 2002 14:18:20 +1000 + +procps (1:2.0.7-8) unstable; urgency=low + + * Removed -ggdb Closes: #117203 + + -- Craig Small Sat, 27 Oct 2001 07:02:38 +1000 + +procps (1:2.0.7-7) unstable; urgency=low + + * Added os/390 patches Closes: #113494 + * w manpage now gives correct location for utmp Closes: #110723 + * watch wrap-around problem fixed Closes: #111759 + * Programs are compilied -O2 Closes: #108652 + + -- Craig Small Wed, 26 Sep 2001 08:08:43 +1000 + +procps (1:2.0.7-6) unstable; urgency=low + + * Re-fixed command line interpretation Closes: #103101 + + -- Craig Small Tue, 10 Jul 2001 17:32:02 +1000 + +procps (1:2.0.7-5) unstable; urgency=low + + * watch now copys strings better. Closes: #95404, #97948, #99780 + * skill.1 loads tbl Closes: #92242, #67899 + * long usernames are shown Closes: #86205, #94957 + * Remove /etc/rcS.d/S30procps with good ole rm Closes: #92184 + * /etc/init.d/procps.sh calls itself that Closes: #93302 + * Cannot write config in secure mode Closes: #93948 + + -- Craig Small Sun, 29 Apr 2001 14:55:20 +1000 + +procps (1:2.0.7-4) unstable; urgency=low + + * watch doesnt crash with long command lines Closes: #88592, #87693 + * bumped up a buffer in a proc read Closes: #85775 + * Now we use 24 hour time Closes: #85640 + * pgrep calls itself pgrep Closes: #86630 + * Corrected symlink in libproc-dev Closes: #87865 + + -- Craig Small Mon, 19 Mar 2001 10:13:27 +1100 + +procps (1:2.0.7-3) unstable; urgency=low + + * Conflicts with pgrep, so no more conflicts Closes: #82835 + * Minor fixes to ps.1 manpage Closes: #81921 + * watch highlighs correctly Closes: #77737 + * top wont die with evil HOMEs, Closes: #81452 + * removed reference to suidregister + * Remore -L reference in kill.1 Closes: #85913 + + -- Craig Small Thu, 8 Feb 2001 12:44:58 +1100 + +procps (1:2.0.7-2) unstable; urgency=medium + + * Moved kill back again, dammit why is the makefile so broken + Closes: #82747 + * Watch uses locale Closes: #82739 + * top's scanf is protected from evil locale problems Closes: #82671, #69128 + (Big thankyou to Guillaume for lending a test account) + + -- Craig Small Fri, 19 Jan 2001 09:15:36 +1100 + +procps (1:2.0.7-1) unstable; urgency=medium + + * New upstream version (010114) + - Merges 2.0.7 code from RedHat Closes: #80832 + - Made note that Shared memory report will be junk due to kernel + Closes: #77818 + - Remove html and null stuff from man page Closes: #81920 + - vsize is kB in man page Closes: #82210 + - man pages look better Closes: #70055, #70941 + - vmstat increase Closes: #77886 + - w tries harder to find things Closes: #24531 + - 15 char user names Closes: #71211 + * No HOME overflow in top Closes: 81452 + * Added menu Hints Closes: #80051, #82324 + + + -- Craig Small Wed, 17 Jan 2001 08:57:24 +1100 + +procps (1:2.0.6-9) unstable; urgency=medium + + * added libncurses5-dev to build-depends, Closes: #67533 + * Put kill back into /bin Closes #67580, #67582 + * Put 2.0.6-7 ps.1 back in Closes: #67451 + + -- Craig Small Tue, 25 Jul 2000 08:13:21 +1000 + +procps (1:2.0.6-8) unstable; urgency=low + + * New upstream source: + * - sysctl EOF bug fixed Closes: #62877 + * - stop crashes with unmounted /proc Closes: #63512, #55177 + * - Versions checking tolerates RH /proc/ksyms Closes: #59798 + * - Top works better with SMP Closes: #34734, #56547, #59703 + + -- Craig Small Fri, 14 Jul 2000 22:33:44 +1000 + +procps (1:2.0.6-7) unstable; urgency=low + + * Fixed missing version Closes: #62207, #62484, #59112 + * Stop crashes with umounted /proc Closes: #63512, #55177 + * Nicer man pages Closes: #63495, #59406 + * Fixed sysctl eof bug Closes: #62877 + * watch wraps properly Closes: #60913 + * watch handles tabs Closes: #46213 + * watch honors locale settings Closes: #63762 + * now versioned replaces line for bsdutils + + -- Craig Small Mon, 29 May 2000 13:31:54 +1000 + +procps (1:2.0.6-6) unstable; urgency=low + + * New patchlevel (000221) + * ps 'f' ASCII art forest fixed. Closes: #57134, #58644 + * let insane people run ps setuid. Closes: #56701 + * note that kernel 2.3 is now faster. Closes: #49130 + * top with WCHAN was leaking memory. Closes: #58172, #52257, #56889 + * can show current CPU. Closes: #37023 + * w looks better now. Closes: #55952 + * init.d/procps removed if exists. Closes: #55137, #55852 + * Fixed skill/snice man page (thanks man-db maint!) Closes: #53736, #46743 + * Fixed ps man page Closes: #58365 + + -- Craig Small Wed, 23 Feb 2000 10:31:37 +1100 + +procps (1:2.0.6-5) unstable; urgency=low + + * New upstream source + * kill "_R(smp_|smp2gig_|2gig_)?[0-9a-fA-F]{8,}" Closes: #54394, #53208 + * added type 'S' and scan past machine types Closes: #54396 + * Fixed w(1) manpage Closes: #54709 + * top now agrees with ps for RSS Closes: #52679 + + -- Craig Small Tue, 11 Jan 2000 08:23:56 +1100 + +procps (1:2.0.6-4) unstable; urgency=low + + * procps init.d script quietly dies if not /etc/default/rcS Closes: + #52839 + * Put the NEWS changelog back in Closes: #52678 + * Fixed that damn Rsmp annoying message bug Closes: #48686 + * Remove /etc/init.d/procps Closes: #53818 + + -- Craig Small Mon, 20 Dec 1999 11:14:53 +1100 + +procps (1:2.0.6-3) unstable; urgency=low + + * Patched ps so it complains if you chmod 711 /proc Closes: #52481 + * Did the same for top. + * Ditto for oldps. + * Changed and int to a char* Closes: #52482 + * sysctl.conf file references sysctl.conf (5) not 8 Closes: #52385 + * props init.d script changed to procps.sh Closes: #52228 + + -- Craig Small Mon, 13 Dec 1999 11:57:01 +1100 + +procps (1:2.0.6-2) unstable; urgency=low + + * Changed psmisc from reccomends to suggests + * %MEM now works, Closes: #50010 #50055 #50148 #50356 + * top doesn't crash with > 204 processes Closes: #50055 + * Another libproc fd leak fixed Closes: #45398 + * ps silently ignores m and -m for future compatibility Closes: #48308 + * Added a sysctl.conf and other files as suggested Closes: #51098 + * Fix start field instability + * ps.1 fixed Closes: #35137 + + -- Craig Small Tue, 7 Dec 1999 14:42:51 +1100 + +procps (1:2.0.6-1) unstable; urgency=low + + * New upstream + * sysctl crash fixed, Closes: #49015 + * libproc file descriptor leak fixed, Closes: #45398 + * False positive System.map mismatches killed, Closes: #49047 + * Supports 64 Hz for StrongARM/Shark Closes: #47461 + * pr_time fixed, Closes: #46223 + * libc num cpu workaround back in, Closes: #49039 + * Fixed kill manpage, Closes: #47018 + * This version definitely, absolutely has kill, Closes: #46762 + + + -- Craig Small Fri, 5 Nov 1999 12:46:05 +1100 + +procps (1:2.0.3-5) unstable; urgency=low + + * Changed conflicts with replaces + + -- Craig Small Wed, 6 Oct 1999 14:36:48 +1000 + +procps (1:2.0.3-4) unstable; urgency=low + + * support SMP systems with versioned kernel modules Closes: #45621, #46465 + * Added kill to this (it is removed from bsdutils). + * We now need kill manpage, Closes: #46004 + + -- Craig Small Tue, 5 Oct 1999 10:28:01 +1000 + +procps (1:2.0.3-3) unstable; urgency=low + + * System.map support for non-i386 Closes: #45592, #45250 + * Do not require /proc/ksyms Closes: #45128, #45132, #45619 + * Alternative w.1 points to the right spot, Closes: #45331 + * Copyright for skill and snice and ps fixed, Closes: #45119 + + -- Craig Small Tue, 21 Sep 1999 16:31:59 +1000 + +procps (1:2.0.3-2) unstable; urgency=medium + + * Now with top! Closes: #45106 + + -- Craig Small Wed, 15 Sep 1999 11:12:34 +1000 + +procps (1:2.0.3-1) unstable; urgency=low + + * New upstream source + * Debian personality does m flag Closes: #44832 + * Corrected typo in top.1 Closes: #44836 + * New improved watch Closes: #29970 + + -- Craig Small Mon, 13 Sep 1999 16:59:16 +1000 + +procps (1:2.0.2-4) unstable; urgency=high + + * Fixed the nasty ps formatting problem (Bug #40859 #40856 #40839 ) + + -- Craig Small Wed, 7 Jul 1999 08:41:54 +1000 + +procps (1:2.0.2-3) unstable; urgency=low + + * New upstream patches/source + * SMB Hz wierdness fixed (Bug #33023 #33284) + * non-tty output does not get chopped at 80 columns (bug #36688) + * BSD personalities set the default selection and output format (bug #36698) + * Fixed collumn spacing problem (Bug #35309) + * Work around for borken libs that return 0 processors (Bug #36902) + * skill now uses process name not command line (Bug #19208) + + -- Craig Small Mon, 5 Jul 1999 07:29:47 +1000 + +procps (1:2.0.2-2) unstable; urgency=low + + * Removed kill and manual page (Bug #36421 #36551 #36375) + * Put in patch for bogus sysconf return (Bug #36494 #36532 #36581) + + -- Craig Small Wed, 28 Apr 1999 09:04:59 +1000 + +procps (1:2.0.2-1) unstable; urgency=low + + * New upstream version (Bug #34394 #27291 #34250 #34956 #35240 #35247 + #35520 #35756 #34580 ) + + -- Craig Small Mon, 19 Apr 1999 13:26:48 +1000 + +procps (1:2.0.0-1) unstable; urgency=low + + * New upstream version (Bug #33083 23347 33462 10556 33266 33371 ) + + + -- Craig Small Mon, 15 Mar 1999 14:21:57 +1100 + +procps (1:1.9.0-2) unstable; urgency=low + + * top now resumes (Bug #32106 ) + * debhelper text problem fixed in postinst (Bug #32963 #33122 #33003 33117 ) + * oldps and ps now use alternatives (Bug #33083 ) + * ps s format now not ugly (Bug #28266 ) + * watch command line help and man page correct (Bug #31702 ) + * sessreg removed from package (Bug #32294 ) + * ps doesn't display extra spaces (Bug #27799 ) + * top has spaces in command lines again (Bug #33060 ) + * ps now has personality (Bug #22923 #18429 ) + * moved non-free skill and snice to non-free package. + + -- Craig Small Tue, 9 Feb 1999 15:10:58 +1100 + +procps (1:1.9.0-1) unstable; urgency=low + + * New Upstream source + + -- Craig Small Thu, 4 Feb 1999 14:48:37 +1100 + +procps (1:1.2.9-3) unstable; urgency=low + + * Linked to ncurses4 + + -- Craig Small Fri, 30 Oct 1998 14:13:02 +1100 + +procps (1:1.2.9-2) unstable; urgency=low + + * top now has spaces in between command lines (Bug #28178 ) + * --version or -V now shows proper version. + + -- Craig Small Mon, 26 Oct 1998 08:55:59 +1100 + +procps (1:1.2.9-1) unstable; urgency=low + + * New upstream version (Bug #27573 ) + * Menu entry changed from System to Menu/System (Bug #27438 ) + * Char variables changed to int for powerpc (Bug #26624 ) + * libproc now nulls allocated structure (Bug #26225 ) + * No longer uses psdevtab (yay!) (Bug #25388 ) + * ps doesn't double space command line parameters (Bug #25306 #24293 ) + * ps now silently ignores g flag for those BSD heads (Bug #24075 ) + + -- Craig Small Fri, 9 Oct 1998 09:15:11 +1000 + +procps (1:1.2.7-2) unstable; urgency=low + + * Top can suspend twice (or three times even) (Bug #22997 ) + * Libraries properly built (Bug #20010 ) + + -- Craig Small Mon, 1 Jun 1998 09:16:09 +1000 + +procps (1:1.2.7-1) frozen unstable; urgency=high + + * New upstream source, fixes security bug (Bug #21475) + + -- Craig Small Thu, 23 Apr 1998 08:04:54 +1000 + +procps (1:1.2.6-2) unstable; urgency=low + + * Fixed Shared library dependencies (bugs #18388 #18394 18392 ) + * Conflicts with earlier versions of w-bassman (bug #18389 ) + + -- Craig Small Mon, 23 Feb 1998 09:05:54 +1100 + +procps (1:1.2.6-1) unstable; urgency=low + + * New upstream source. + * xload is undiverted (Bug #17102 ) + * ps_fields.7.gz removed (Bug #18090 ) + * Colour patches removed, color-related bugs gone (Bug #18008 #17217 #18090 ) + * POSIX patches removed, cmd line bugs gone (Bug #15537 ) + * w is now an alternative w.procps (Bug #17960 ) + * skill now works with process names (Bug #17087 ) + * ps and top man pages have their field descriptions (Bug #17360 ) + * ps u fixed (Bug #17313 ) + * Source code is no longer FUBAR (Bug #17892 ) + * top now redraws screen after config screen (Bug #11896 ) + * Circular dependency removed (Bug #16966 ) + * top does mess up screens with wrong cmd line (Bug #17230 ) + * top suspends with ctrl-Z (Bug #16703 ) + + -- Craig Small Tue, 17 Feb 1998 08:31:21 +1100 + +procps (1:1.2.5-2) unstable; urgency=low + + * Moved /bin into /bin/ps (Bug #17001 ) + + -- Craig Small Tue, 13 Jan 1998 07:50:43 +1100 + +procps (1:1.2.5-1) unstable; urgency=low + + * TTY selection works ( #16724 ) + * top and ps now accept --colour and *_COLOURS + * xproc copyright file not compressed ( #14491 ) + * All #include now #include "proc/*.h" ( #13482 ) + * Copyright doesn't mention psmisc now ( #16704 ) + * Moved ps back into /bin ( #16737 #16705 ) + * New upstream source ( #16795 ) + + -- Craig Small Mon, 12 Jan 1998 08:35:10 +1100 + +procps (1:1.2.2-1) unstable; urgency=low + + * New maintainer + * Updated upstream source to 1.2.2 (instead of 1.2) + * Merged Helmut's color/command line patches into upstream. + * Copyright file is not compressed ( #14493 #14415 ) + * psdatabase refreshed when installing ( #10693 ) + * Fixed +/- line in free ( #10785 #10870 #11566 #12027 #12245 #12374 ) + * w collumns corrected ( #10898 #13117 ) + * top saves sort type ( #11553 ) + * Linked to libc6 ( #11725 ) + * top doesn't coredump with S option ( #11855 ) + * skill works with given patch ( #12023 ) + * libproc-dev has proper sym link ( #12697 ) + * top -h doesn't change terminal settings ( #13513 ) + * ps -s has "CAUGHT" not "CATCHED" ( #14342 ) + * ps_colors.7 and ps_fields.7 reformatted ( #14109 #14544 #14545 ) + * ps checks for tty before using colors ( #14596 ) + * top sets stop signal handler later, stopping race ( #14769 ) + * When using POSIX personality, processes show up ( #14780 ) + * top checks for valid term type ( #15807 ) + * xproc now Depends on procps-1.2.*-* ( #10762 #13347 ) + * xproc dependencies fixed ( #12698 ) + + -- Craig Small Tue, 30 Dec 1997 11:33:54 +1100 + +procps (1.12.2.1) unstable; urgency=low + + * Non-maintainer release, built for libc6. + * Added in free.c from new procps version 1.2.3 (from sunsite), seems to + fix all the problems with free reporting bogus valus. + + -- Joey Hess Fri, 24 Oct 1997 13:34:35 -0400 + +procps (1.12.2) stable unstable; urgency=low + + * fixed meminfo handling again, as the fix wouldn't work on pre-2.1.x + kernels. + * fixed free to use the meminfo routines from libproc. + + -- Helmut Geyer Fri, 13 Jun 1997 22:42:14 +0200 + +procps (1.12.1) stable unstable; urgency=low + + * fixed several bugs + * replaced utmp handling to support wrappers. + * added /proc/meminfo support for 2.1.x kernels. + + -- Helmut Geyer Tue, 10 Jun 1997 23:59:41 +0200 + +procps (1.11.6) frozen unstable; urgency=medium + + * psmisc 1.14 : new upstream version (mainly bugfixes) + * added a lot of new serial device major numbers to the device lookup + code. Somehow it seems there are new serial devices every other week. + * fixed a bug in top: broken .toprc may cause a segmentation fault. + + -- Helmut Geyer Sun, 4 May 1997 09:50:30 +0200 + +procps (1.11.5) frozen unstable; urgency=medium + + * minor changes to make it compile with libc6 + * fix top behaviour on machines having nonstandard NR_TASKS up to 4k + tasks + + -- Helmut Geyer Fri, 18 Apr 1997 02:07:46 +0200 + +procps (1.11.4) unstable; urgency=medium + + * strip libproc.so from unneeded symbols (Bug# 8311) + * fixed watch.1 example (Bug# 8169) + * partly fixed fuser sigsegv core dump (Bug# 8004) + * menu entries for xproc and procps (Bug# 8325) + * divertions for xmem and xload. (Bug# 7565) + + -- Helmut Geyer Sun, 13 Apr 1997 20:55:05 +0200 + +procps (1.11.3) unstable; urgency=low + + * fixed uptime again, minor Makefile changes + + -- Helmut Geyer Fri, 21 Feb 1997 16:22:04 +0100 + +procps (1.11.2) unstable; urgency=medium + + * fixed typo in ps_fields.7 (Bug#5457) + * fixed typo in debian/rules (Bug #5585) + * fixed bug in w introduced in 1.11.1 (Bugs #5489, #5694, #5695, #5705). + * added support for non-standard serial devices (long overdue - Bug + #5771). + * fixed uptime option handling (Bug #6099). + * fixed top problems with missing/corrupted utmp (Bug #5819). + * fixed manpage problems (Bug #5936). + + -- Helmut Geyer Wed, 19 Feb 1997 18:49:26 +0100 + +procps (1.11.1) unstable; urgency=low + + * fixed bug in w + * automatic resize if field length is exceeded. This changed the shared + library, so popping the major number. + * fixed numeric WCHAN output on Alphas and stupid bug in ps (again, + thanks to H. Koenig). + * fixed top memory statistics for systems with more than 100M memory or + swap. + + -- Helmut Geyer Tue, 12 Nov 1996 02:57:18 +0100 + +procps (1.10.1) unstable; urgency=low + + * merged in ALPHA & Sparc patches + (from ftp.azstarnet.com:/pub/linux/axp/glibc) + * fixed ps --deselect/-N for pid lists + * use shared libs from now on, install shlibs again + * manpages for libproc + * static lib compiled without -fPIC + * added libproc package for development installing libproc headers, + manpages and static library. + * fixed PROC_REAL bug when PROC_FILLSTATUS isn't set. + * fixed color bug in ps --forest + * added xproc package for xload, xmem, xidle, xcpustate + (XConsole left out as we use xconsole & klogd on debian) + * adapted xload manpage for xidle and xmem + * fixed xmem to cope with newer kernels (where shared pages are counted + once for each additional reference) + * fixed top change_fields bug (a field needs 24, not 21 spaces) + * fixed several Alpha bugs (thanks to Harald Koenig) + * due to popular demand, the old format for time intervals is back. + for all program using this, a toggle command line option has been + provided. The default behaviour depends on the compile time option + NEW_TIME_DEFAULT (see main Makefile) + + -- Helmut Geyer Wed, 23 Oct 1996 21:30:54 +0200 + +procps (1.09.2) unstable; urgency=low + + * fixed cpu nice % in summary + * fixed topsetup initialisation in top.h I messed up in last revision + * fixed pipe output bug + * fixed --deselect bug in SVR4/POSIX mode + + -- Helmut Geyer Sun, 20 Oct 1996 13:57:11 +0200 + +procps (1.09.1) unstable; urgency=low + + * fixed ps -w bug displaying too many empty lines + * fixed SIGSEGV bug in ps -www + * fixed bug in top not calculating length of the command/args/env fields + at the field selection screen in some circumstances. + * fixed SIGSEGV bug when using environ field + + -- Helmut Geyer Sat, 12 Oct 1996 07:59:29 +0200 + +procps (1.09) experimental; urgency=low + + * This is an experimental release of the procps suite. A lot of features have + been added since the 1.01(a) release: + - support for both BSD and POSIX (SVR4) style command line options. + - completely configurable display of information. + - colour markup of processes exceeding limits or belonging to a user. + Please take a look at /usr/doc/procps/NEWS and the manpages for a concise + list. This is how the next upstream release of procps may look + (i.e. it will look like this if there is not too much resistance). + + -- Helmut Geyer Sat, 5 Oct 1996 14:26:57 +0200 + --- procps-3.2.7.orig/debian/sysctl.conf +++ procps-3.2.7/debian/sysctl.conf @@ -0,0 +1,67 @@ +# +# /etc/sysctl.conf - Configuration file for setting system variables +# See /etc/sysctl.d/ for additional system variables. +# See sysctl.conf (5) for information. +# + +#kernel.domainname = example.com + +# Uncomment the following to stop low-level messages on console +#kernel.printk = 4 4 1 7 + +##############################################################3 +# Functions previously found in netbase +# + +# Uncomment the next two lines to enable Spoof protection (reverse-path filter) +# Turn on Source Address Verification in all interfaces to +# prevent some spoofing attacks +#net.ipv4.conf.default.rp_filter=1 +#net.ipv4.conf.all.rp_filter=1 + +# Uncomment the next line to enable TCP/IP SYN cookies +# This disables TCP Window Scaling (http://lkml.org/lkml/2008/2/5/167), +# and is not recommended. +#net.ipv4.tcp_syncookies=1 + +# Uncomment the next line to enable packet forwarding for IPv4 +#net.ipv4.ip_forward=1 + +# Uncomment the next line to enable packet forwarding for IPv6 +#net.ipv6.conf.all.forwarding=1 + + +################################################################### +# Additional settings - these settings can improve the network +# security of the host and prevent against some network attacks +# including spoofing attacks and man in the middle attacks through +# redirection. Some network environments, however, require that these +# settings are disabled so review and enable them as needed. +# +# Ignore ICMP broadcasts +#net.ipv4.icmp_echo_ignore_broadcasts = 1 +# +# Ignore bogus ICMP errors +#net.ipv4.icmp_ignore_bogus_error_responses = 1 +# +# Do not accept ICMP redirects (prevent MITM attacks) +#net.ipv4.conf.all.accept_redirects = 0 +#net.ipv6.conf.all.accept_redirects = 0 +# _or_ +# Accept ICMP redirects only for gateways listed in our default +# gateway list (enabled by default) +# net.ipv4.conf.all.secure_redirects = 1 +# +# Do not send ICMP redirects (we are not a router) +#net.ipv4.conf.all.send_redirects = 0 +# +# Do not accept IP source route packets (we are not a router) +#net.ipv4.conf.all.accept_source_route = 0 +#net.ipv6.conf.all.accept_source_route = 0 +# +# Log Martian Packets +#net.ipv4.conf.all.log_martians = 1 +# +# The contents of /proc//maps and smaps files are only visible to +# readers that are allowed to ptrace() the process +# kernel.maps_protect = 1 --- procps-3.2.7.orig/debian/compat +++ procps-3.2.7/debian/compat @@ -0,0 +1 @@ +7 --- procps-3.2.7.orig/debian/rules +++ procps-3.2.7/debian/rules @@ -0,0 +1,156 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# Include dpatch stuff +include /usr/share/dpatch/dpatch.make + +PACKAGE="procps" +DEBROOT=$(CURDIR)/debian/procps + +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) +CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc +else +CROSS= +endif + + +DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) + +CFLAGS=-g + +build: build-stamp + +build-stamp: patch-stamp + dh_testdir + + [ -d static ] || mkdir static + $(MAKE) $(CROSS) lib64=lib SHARED=0 CFLAGS="$(CFLAGS)" proc/libproc.a + mv proc/libproc.a static + $(MAKE) clean + $(MAKE) $(CROSS) W_SHOWFROM=\-DW_SHOWFROM lib64=lib CFLAGS="$(CFLAGS)" + + touch build-stamp + +clean: clean1 unpatch +clean1: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + rm -rf static + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + # Add here commands to install the package into debian/procps. + $(MAKE) $(CROSS) lib64=lib ln_f="ln -sf" ldconfig=echo DESTDIR=$(DEBROOT) install + install --mode 644 -o root -g root debian/sysctl.conf $(DEBROOT)/etc/ + install --mode 644 -o root -g root debian/sysctl.d/*.conf debian/sysctl.d/README $(DEBROOT)/etc/sysctl.d/ +ifneq (,$(wildcard debian/sysctl.d/*.conf.$(DEB_HOST_ARCH))) + cat debian/sysctl.d/*.conf.$(DEB_HOST_ARCH) >> $(DEBROOT)/etc/sysctl.d/10-arch-specific.conf +endif + cp debian/lintian $(DEBROOT)/usr/share/lintian/overrides/procps + cp debian/bug-presubj $(DEBROOT)/usr/share/bug/procps/presubj + + # Rename w as there are two of them + (cd $(DEBROOT)/usr/bin && mv w w.procps ) + (cd $(DEBROOT)/usr/share/man/man1 && mv w.1 w.procps.1 ) + + + # Work-around until proc includes fixed + (cp proc/*.h $(CURDIR)/debian/libproc-dev/usr/include/proc) + cp static/libproc.a $(CURDIR)/debian/libproc-dev/usr/lib + +ifneq ($(DEB_HOST_ARCH_OS), linux) + rm -f \ + $(CURDIR)/debian/procps/usr/bin/slabtop \ + $(CURDIR)/debian/procps/usr/share/man/man1/slabtop.1 \ + $(CURDIR)/debian/procps/sbin/sysctl \ + $(CURDIR)/debian/procps/usr/share/man/man8/sysctl.8 \ + $(NULL) +endif +ifeq ($(DEB_HOST_ARCH_OS), kfreebsd) + rm -f \ + $(CURDIR)/debian/procps/bin/kill \ + $(CURDIR)/debian/procps/usr/share/man/man1/kill.1 \ + $(NULL) +endif +ifeq ($(DEB_HOST_ARCH_OS), hurd) + rm -f \ + $(CURDIR)/debian/procps/usr/bin/pmap \ + $(CURDIR)/debian/procps/usr/share/man/man1/pmap.1 \ + $(NULL) + # Rename kill as there are two of them + (cd $(DEBROOT)/bin && mv kill kill.procps ) + (cd $(DEBROOT)/usr/share/man/man1 && mv kill.1 kill.procps.1 ) + + # Rename vmstat as there are two of them + (cd $(DEBROOT)/usr/bin && mv vmstat vmstat.procps ) + (cd $(DEBROOT)/usr/share/man/man8 && mv vmstat.8 vmstat.procps.8 ) + + # Rename uptime as there are two of them + (cd $(DEBROOT)/usr/bin && mv uptime uptime.procps ) + (cd $(DEBROOT)/usr/share/man/man1 && mv uptime.1 uptime.procps.1 ) + + # Rename ps as there are two of them + (cd $(DEBROOT)/bin && mv ps ps.procps ) + (cd $(DEBROOT)/usr/share/man/man1 && mv ps.1 ps.procps.1 ) +endif + + dh_movefiles --sourcedir=debian/procps + #rmdir $(CURDIR)/debian/procps/usr/include/proc + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs NEWS + dh_installdocs + dh_installexamples + dh_install + dh_installmenu +# dh_installdebconf +# dh_installlogrotate +# dh_installemacsen +# dh_installcatalogs +# dh_installpam +# dh_installmime +ifneq ($(DEB_HOST_ARCH_OS), kfreebsd) + dh_installinit --update-rcd-params='start 17 S .' +endif +# dh_installcron + dh_installinfo +# dh_undocumented + dh_installman + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_perl +# dh_makeshlibs -V "procps (>= 3.2.7), procps (<< 3.2.8)" + dh_makeshlibs -V + dh_installdeb + dh_shlibdeps -L procps -l debian/procps/lib + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install patch unpatch clean1 --- procps-3.2.7.orig/debian/libproc-dev.dirs +++ procps-3.2.7/debian/libproc-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include/proc --- procps-3.2.7.orig/debian/w.de.1 +++ procps-3.2.7/debian/w.de.1 @@ -0,0 +1,73 @@ +.\" -*-Nroff-*- +.\" +.TH W 1 "8 Dez 1993 " " " "Linux Benutzerhandbuch" +.SH NAME +w \- Zeigt an, wer am System angemeldet ist und was sie/er gerade tut. +.SH SYNTAX +.B w +.RB [ \-husfVo ] +.RI [ Benutzer ] +.SH BESCHREIBUNG +.B w +zeigt Informationen über die gerade eingeloggten Benutzer und ihre Prozesse an. Die Kopfzeile enthält die aktuelle Zeit, die Zeit, seit der das System läuft, wie viele Benutzer gerade angemeldet sind und die durchschnittliche Systemlast der letzten 1, 5 und 15 Minuten. + +Die folgenden Daten werden für jeden Benutzer angezeigt: +Der Login-Name, der tty-Name, der entfernte Host, die Login-Zeit, die Leerlaufzeit, JCPU , PCPU und die Kommandozeile des laufenden Prozesses. + +Die JCPU-Zeit ist die Zeit, die von allen Prozessen genutzt wurde, die an dem jeweiligen Terminal angemeldet sind. Sie enthält keine abgeschlossenen Hintergrund-Aufträge, jedoch die derzeit laufenden Hintergrund-Aufträge. + +Die PCPU-Zeit ist die Zeit, die vom derzeit laufenden Prozess bisher genutzt wurde. + +.PP +.SH "OPTIONEN" +.TP 0.5i +.B "\-h " +Die Kopfzeile nicht ausgegeben. +.TP 0.5i +.B "\-u " +Ignoriert den Benutzernamen während der aktuelle Prozess und die CPU-Zeiten ermittelt werden. Probieren Sie die Option aus, indem Sie zunächst "su", danach "w" und "w \-u" eingeben. +.TP 0.5i +.B "\-s " +Das kurze Ausgabeformat verwenden. +Den Anmeldenamen, die JCPU und PCPU nicht ausgeben. +.TP 0.5i +.B "\-f " +Umschalten des +.B from +(remote host) Feldes. Die Standardeinstellung ist, das +.B from +Feld nicht auszugeben. Evtl. hat ihr Systemadministrator oder Paketbetreuer jedoch auch eine Version kompiliert, in der das +.B from +Feld standardmäßig angezeigt wird. +.TP 0.5i +.B "\-V " +Versionsinformation anzeigen. +.TP 0.5i +.B "\-o " +Altes Ausgabeformat. Druckt Leerzeichen für Leerlaufzeiten unter einer Minute. +.TP 0.5i +.B "Benutzer " +Zeigt nur Informationen über den angegebenen Benutzer an. + +.SH DATEIEN +.TP +.I /var/run/utmp +Informationen darüber, wer gerade angemeldet ist +.TP +.I /proc +Prozessinformationen +.PP + +.SH "SIEHE AUCH" +.BR free (1), +.BR ps (1), +.BR top (1), +.BR uptime (1), +.BR utmp (5), +.BR who (1) + +.SH AUTOREN +.B w +ist von Charles Blake fast vollständig neu geschrieben worden. Die ursprüngliche Version wurde von Larry Greenfield und Michael K. Johnson geschrieben. + +Berichten Sie Fehler an \ No newline at end of file --- procps-3.2.7.orig/debian/procps.dirs +++ procps-3.2.7/debian/procps.dirs @@ -0,0 +1,12 @@ +etc +etc/sysctl.d/ +lib +sbin +bin +usr/bin +usr/share/bug/procps +usr/share/lintian/overrides +usr/share/man/man1 +usr/share/man/man5 +usr/share/man/man8 + --- procps-3.2.7.orig/debian/examples +++ procps-3.2.7/debian/examples @@ -0,0 +1,2 @@ +debian/sysctl.conf + --- procps-3.2.7.orig/debian/prerm +++ procps-3.2.7/debian/prerm @@ -0,0 +1,15 @@ +#!/bin/sh +set -e + +case "$1" in + remove|deconfigure) + update-alternatives --remove w /usr/bin/w.procps + ;; + upgrade|failed-upgrade) + ;; +esac + +#DEBHELPER# + +exit 0 + --- procps-3.2.7.orig/debian/copyright +++ procps-3.2.7/debian/copyright @@ -0,0 +1,63 @@ +This is the Debian Linux prepackaged version of the /proc file +system utilities. + +This package was downloaded from: + http://procps.sourceforge.net/ + + +Upstream Authors: +Werner Almesberger , Roger Binns, Charles +Blake , Brian Edmonds, David Engel , +Larry Greenfield , Michael K. Johnson +, Branko Lankester , +Robert Nation , Michael Shields +, Henry Ware , Matt +Welsh , Albert D. Cahalan, Jim C. Warner +, and Kjetil Torgrim Homme + + +Copyright: + free.c: + Copyright 2003 Robert Love + Copyright 2004 Albert Cahalan + minimal.c: + Copyright 1998,2004 Albert Cahalan + pgrep.c: + Copyright 2000 Kjetil Torgrim Homme + pmap.c: + Copyright 2002 by Albert Cahalan + pwdx.c: + Copyright 2004 Nicholas Miell + skill.c: + Copyright 1998-2002 by Albert Cahalan + slabtop.c: + Copyright 2003 Chris Rivera + sysctl.c: + Copyright 1999 George Staikos + tload.c: + Copyright 1992 Branko Lankester + top.c: + Copyright 2002 James C. Warner + vmstat.c: + Copyright 1994 Henry Ware + Copyright 2002 Albert Cahalan + ps/display.c, ps/parser.c: + Copyright 1998-2003 by Albert Cahalan + ps/global.c, ps/global.c: + Copyright 1998-2002 by Albert Cahalan + ps/help.c, ps/sortformat.c: + Copyright 1998-2004 by Albert Cahalan + ps/output.c: + Copyright 1999-2004 by Albert Cahalan + +License: +The programs sysctl and pgrep copyright by their +authors and redistributable under the terms of the GNU General +Public License. On Debian Linux systems, the complete text of +the GNU General Public License can be found in +`/usr/share/common-licenses/GPL'. + +All other software is copyright by their authors and redistributable under +the terms of the GNU Library General Public License. On Debian Linux +systems, the complete text of the GNU Library General Public License can +be found in `/usr/share/common/licenses/LGPL'. --- procps-3.2.7.orig/debian/bug-presubj +++ procps-3.2.7/debian/bug-presubj @@ -0,0 +1,5 @@ +If you are reporting on the kill program please make sure you are running +/bin/kill and not the shell built-in kill program (which is usually the +default one used). + +ps WILL print UIDs instead of usernames if they are longer than 8 characters. --- procps-3.2.7.orig/debian/procps.manpages +++ procps-3.2.7/debian/procps.manpages @@ -0,0 +1,2 @@ +ps/ps.1 +debian/w.de.1 --- procps-3.2.7.orig/debian/lintian +++ procps-3.2.7/debian/lintian @@ -0,0 +1 @@ +procps: package-name-doesnt-match-sonames --- procps-3.2.7.orig/debian/preinst +++ procps-3.2.7/debian/preinst @@ -0,0 +1,102 @@ +#!/bin/sh +# preinst script for procps +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `install' +# * `install' +# * `upgrade' +# * `abort-upgrade' +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + +# Prepare to remove a no-longer used conffile +prep_rm_conffile() +{ + PKGNAME="$1" + CONFFILE="$2" + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" != "$old_md5sum" ]; then + echo "Obsolete conffile $CONFFILE has been modified by you, renaming to .dpkg-bak" + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + mv -f "$CONFFILE" "$CONFFILE".dpkg-obsolete + fi + fi +} + +prep_mv_conffile() +{ + PKGNAME=$1 + CONFFILE=$2 + + if [ -e "$CONFFILE" ]; then + md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`" + old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`" + if [ "$md5sum" = "$old_md5sum" ]; then + rm -f "$CONFFILE" + fi + fi +} + +upgradeoldconffile() +{ + f=/etc/init.d/procps.sh + [ ! -e "$f" ] && return + + curmd5=`md5sum "$f" |awk '{print $1}'` + oldmd5=`dpkg-query -W -f='${Conffiles}' procps | sed "{\\'^ $f ' ! d; s///}"` + [ "$curmd5" = "$oldmd5" ] && { + # The admin has not modified $f + echo "Preparing to remove obsolete, unmodified conffile: $f" + mv -fv "$f" "$f.from-preinst" + return + } >&2 + + # The admim modified $f; cause a deliberate conffile prompt + echo "Moving obsolete conffile to new pathname:" + mv -fv "$f" "${f%.sh}" +} + + +case "$1" in + install) + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then + prep_rm_conffile procps /etc/sysctl.d/10-tcp-timestamps-workaround.conf + fi + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then + prep_rm_conffile procps /etc/sysctl.d/10-process-security.conf + fi + ;; + upgrade) + prep_mv_conffile procps "/etc/init.d/procps.sh" + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then + prep_rm_conffile procps /etc/sysctl.d/10-tcp-timestamps-workaround.conf + fi + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then + prep_rm_conffile procps /etc/sysctl.d/10-process-security.conf + fi + ;; + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- procps-3.2.7.orig/debian/docs +++ procps-3.2.7/debian/docs @@ -0,0 +1,4 @@ +BUGS +TODO +README.top + --- procps-3.2.7.orig/debian/postinst +++ procps-3.2.7/debian/postinst @@ -0,0 +1,127 @@ +#!/bin/sh +# postinst script for procps +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +# Remove a no-longer used conffile +rm_conffile() +{ + CONFFILE="$1" + + if [ -e "$CONFFILE".dpkg-obsolete ]; then + echo "Removing obsolete conffile $CONFFILE" + rm -f "$CONFFILE".dpkg-obsolete + fi +} + +# Move a conffile without triggering a dpkg question +mv_conffile() { + OLDCONFFILE="$1" + NEWCONFFILE="$2" + + if [ -e "$OLDCONFFILE" ]; then + echo "Preserving user changes to $NEWCONFFILE ..." + mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new + mv -f "$OLDCONFFILE" "$NEWCONFFILE" + fi +} + +# update alternative, if it exists +check_alternatives() { + BINNAME="$1" + BINPATH="$2" + MANSEC="$3" + if [ -e "$BINPATH"/"$BINNAME".procps ] ; then + update-alternatives --install "$BINPATH"/"$BINNAME" "$BINNAME" \ + "$BINPATH"/"$BINNAME".procps 50 \ + --slave /usr/share/man/man"$MANSEC"/"$BINNAME"."$MANSEC".gz "$BINNAME"."$MANSEC".gz \ + /usr/share/man/man"$MANSEC"/"$BINNAME".procps."$MANSEC".gz + fi +} +case "$1" in + configure|abort-remove|abort-deconfigure) + if [ -e /etc/psdevtab ] ; then + rm -f /etc/psdevtab + fi + if [ -e /etc/psdatabase ] + then + rm -f /etc/psdatabase + fi + # Remove old procps init.d script, if it exists Closes: #55137 + if [ -L /etc/rcS.d/S30procps.sh ] + then + update-rc.d -f procps.sh remove >/dev/null + fi + # and if that didn't work Closes: #92184 (#234306 with -L ) + if [ -L /etc/rcS.d/S30procps.sh ] + then + rm -f /etc/rcS.d/S30procps.sh + fi + if [ -L /etc/rcS.d/S05procps.sh ]; then + rm -f /etc/rcS.d/S05procps.sh + fi + # Ubuntu had this link at S17, leaving cruft behind on upgrade: + if [ -L /etc/rcS.d/S17procps.sh ]; then + rm -f /etc/rcS.d/S17procps.sh + fi + # Remove moved procps.sh file, if it is there + if dpkg --compare-versions "$2" le "1:3.2.7-3"; then + mv_conffile "/etc/init.d/procps.sh" "/etc/init.d/procps" + fi + + # + # Now to do the alternatives for w + update-alternatives --install /usr/bin/w w /usr/bin/w.procps 50 \ + --slave /usr/share/man/man1/w.1.gz w.1.gz /usr/share/man/man1/w.procps.1.gz + # Do alternatives for uptime kill vmstat and ps, if required + check_alternatives "uptime" "/usr/bin" "1" + check_alternatives "kill" "/usr/bin" "1" + check_alternatives "vmstat" "/usr/bin" "8" + check_alternatives "ps" "/bin" "1" + + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu1; then + rm_conffile /etc/sysctl.d/10-tcp-timestamps-workaround.conf + fi + if dpkg --compare-versions "$2" lt-nl 1:3.2.7-11ubuntu2; then + rm_conffile /etc/sysctl.d/10-process-security.conf + fi + ;; + + abort-upgrade) + # Nothing to do + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + --- procps-3.2.7.orig/debian/patches/20_w-bassman.dpatch +++ procps-3.2.7/debian/patches/20_w-bassman.dpatch @@ -0,0 +1,91 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_w-bassman.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: w-bassman emulation with -o flag +## DP: Was from #45947, corrected for #414906 + +@DPATCH@ +diff -urNad procps-3.2.7~/w.1 procps-3.2.7/w.1 +--- procps-3.2.7~/w.1 2009-01-09 16:24:17.000000000 +1100 ++++ procps-3.2.7/w.1 2009-01-09 16:24:55.000000000 +1100 +@@ -5,7 +5,7 @@ + w \- Show who is logged on and what they are doing. + .SH SYNOPSIS + .B w \- +-.RB [ husfV ] ++.RB [ husfVo ] + .RI [ user ] + .SH DESCRIPTION + .B "w " +@@ -55,6 +55,9 @@ + .B "\-V " + Display version information. + .TP 0.5i ++.B "\-o " ++Old style output. Prints blank space for idle times less than one minute. ++.TP 0.5i + .B "user " + Show information about the specified user only. + +diff -urNad procps-3.2.7~/w.c procps-3.2.7/w.c +--- procps-3.2.7~/w.c 2009-01-09 16:24:54.000000000 +1100 ++++ procps-3.2.7/w.c 2009-01-09 16:25:39.000000000 +1100 +@@ -30,6 +30,7 @@ + #include + + static int ignoreuser = 0; /* for '-u' */ ++static int oldstyle = 0; /* for '-o' */ + static proc_t **procs; /* our snapshot of the process table */ + + typedef struct utmp utmp_t; +@@ -76,6 +77,16 @@ + printf(" ? "); + return; + } ++ if (oldstyle) { ++ if (t >= 48*60*60) /* > 2 days */ ++ fprintf(fout, " %2ludays", t/(24*60*60)); ++ else if (t >= 60*60) /* > 1 hour */ ++ fprintf(fout, " %2lu:%02u ", t/(60*60), (unsigned) ((t/60)%60)); ++ else if (t > 60) /* > 1 minute */ ++ fprintf(fout, " %2lu:%02um", t/60, (unsigned) t%60); ++ else ++ fprintf(fout, " "); ++ } else { + if (t >= 48*60*60) /* > 2 days */ + fprintf(fout, " %2ludays", t/(24*60*60)); + else if (t >= 60*60) /* > 1 hour */ +@@ -84,6 +95,7 @@ + fprintf(fout, " %2lu:%02u ", t/60, (unsigned) t%60); + else + fprintf(fout, " %2lu.%02us", t, centi_sec); ++ } + } + + /**** stat the device file to get an idle time */ +@@ -239,7 +251,7 @@ + #endif + + setlocale(LC_ALL, ""); +- for (args=0; (ch = getopt(argc, argv, "hlusfV")) != EOF; args++) ++ for (args=0; (ch = getopt(argc, argv, "hlusfVo")) != EOF; args++) + switch (ch) { + case 'h': header = 0; break; + case 'l': longform = 1; break; +@@ -247,6 +259,7 @@ + case 'f': from = !from; break; + case 'V': display_version(); exit(0); + case 'u': ignoreuser = 1; break; ++ case 'o': oldstyle = 1; break; + default: + printf("usage: w -hlsufV [user]\n" + " -h skip header\n" +@@ -254,6 +267,7 @@ + " -s short listing\n" + " -u ignore uid of processes\n" + " -f toggle FROM field (default %s)\n" ++ " -o old-style output\n" + " -V display version\n", FROM_STRING); + exit(1); + } --- procps-3.2.7.orig/debian/patches/30_readproc_c.dpatch +++ procps-3.2.7/debian/patches/30_readproc_c.dpatch @@ -0,0 +1,45 @@ +#! /bin/sh -e +## 30_readproc_c.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: readproc.c some type conversion help +## DP: return if unable to open /proc + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +--- procps-3.2.0.orig/proc/readproc.c ++++ procps-3.2.0/proc/readproc.c +@@ -162,7 +162,7 @@ + // examine a field name (hash and compare) + base: + if(unlikely(!*S)) break; +- entry = table[63 & (asso[S[3]] + asso[S[2]] + asso[S[0]])]; ++ entry = table[63 & (asso[(int)S[3]] + asso[(int)S[2]] + asso[(int)S[0]])]; + colon = strchr(S, ':'); + if(unlikely(!colon)) break; + if(unlikely(colon[1]!='\t')) break; +@@ -888,6 +888,8 @@ + else + PT = openproc(flags); + va_end(ap); ++ if (!PT) ++ return 0; + do { /* read table: */ + tab = xrealloc(tab, (n+1)*sizeof(proc_t*));/* realloc as we go, using */ + tab[n] = readproc_direct(PT, NULL); /* final null to terminate */ --- procps-3.2.7.orig/debian/patches/20_Makefile_lib64.dpatch +++ procps-3.2.7/debian/patches/20_Makefile_lib64.dpatch @@ -0,0 +1,44 @@ +#! /bin/sh -e +## 20_Makefile_lib64.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Removed entry about /lib64 as it breaks the sparc + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +--- procps/Makefile.orig Thu Apr 1 22:07:46 2004 ++++ procps/Makefile Thu Apr 1 22:08:31 2004 +@@ -31,7 +31,7 @@ + install := install -D --owner 0 --group 0 + + # Lame x86-64 /lib64 and /usr/lib64 abomination: +-lib64 := lib$(shell [ -d /lib64 ] && echo 64) ++lib64 := lib + + usr/bin := $(DESTDIR)/usr/bin/ + bin := $(DESTDIR)/bin/ +@@ -110,7 +110,7 @@ + ALL_CFLAGS += $(call check_gcc,-Wpadded,) + + # Be 64-bit if at all possible. +-ALL_CFLAGS += $(call check_gcc,-m64,) ++#ALL_CFLAGS += $(call check_gcc,-m64,) + + endif + endif --- procps-3.2.7.orig/debian/patches/20_top_c_resize.dpatch +++ procps-3.2.7/debian/patches/20_top_c_resize.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20top_resize_terminal.dpatch by +## +## DP: Prevent top from segfaulting when the display is shrinked to only +## DP: a few (read: 3 or less) lines. + +@DPATCH@ +--- procps-3.2.7.orig/top.c 2006-06-25 08:41:48.000000000 +0200 ++++ procps-3.2.7/top.c 2007-08-06 03:27:28.000000000 +0200 +@@ -140,7 +140,7 @@ + are exploited in a macro and represent 90% of our optimization. + The Stdout_buf is transparent to our code and regardless of whose + buffer is used, stdout is flushed at frame end or if interactive. */ +-static char *Pseudo_scrn; ++static PSEUDO_SCREEN_t Pseudo_scrn; + static int Pseudo_row, Pseudo_cols, Pseudo_size; + #ifndef STDOUT_IOLBF + // less than stdout's normal buffer but with luck mostly '\n' anyway +@@ -2415,7 +2415,10 @@ + Pseudo_cols = Screen_cols + CLRBUFSIZ + 1; + if (Batch) Pseudo_size = ROWBUFSIZ + 1; + else Pseudo_size = Pseudo_cols * Screen_rows; +- Pseudo_scrn = alloc_r(Pseudo_scrn, Pseudo_size); ++ if( Pseudo_scrn.buf == NULL || Pseudo_size > Pseudo_scrn.mem_size ) { ++ Pseudo_scrn.buf = alloc_r(Pseudo_scrn.buf, Pseudo_size); ++ Pseudo_scrn.mem_size = Pseudo_size; ++ } + + // force rebuild of column headers AND libproc/readproc requirements + Frames_libflags = 0; +@@ -3289,7 +3292,7 @@ + // reframewins(), who also builds each window's column headers + if (!Frames_libflags) { + reframewins(); +- memset(Pseudo_scrn, '\0', Pseudo_size); ++ memset(Pseudo_scrn.buf, '\0', Pseudo_size); + } + Pseudo_row = Msg_row = scrlins = 0; + ppt = summary_show(); +--- procps-3.2.7.orig/top.h 2006-06-25 08:41:48.000000000 +0200 ++++ procps-3.2.7/top.h 2007-08-06 03:27:28.000000000 +0200 +@@ -135,7 +135,7 @@ + int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg); \ + putp ( Batch ? _str : \ + ({ \ +- char *restrict const _pse = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols]; \ ++ char *restrict const _pse = &Pseudo_scrn.buf[Pseudo_row++ * Pseudo_cols]; \ + memcmp(_pse, _str, _len) ? memcpy(_pse, _str, _len) : "\n"; \ + }) \ + ); \ +@@ -149,7 +149,11 @@ + int _len = 1 + snprintf(_str, sizeof(_str), fmt, ## arg); \ + if (Batch) _ptr = _str; \ + else { \ +- _ptr = &Pseudo_scrn[Pseudo_row++ * Pseudo_cols]; \ ++ if (Pseudo_row * Pseudo_cols + _len > Pseudo_size) { \ ++ Pseudo_scrn.buf = realloc(Pseudo_scrn.buf, Pseudo_row * Pseudo_cols + _len); \ ++ Pseudo_scrn.mem_size = Pseudo_size = Pseudo_row * Pseudo_cols + _len; \ ++ } \ ++ _ptr = &Pseudo_scrn.buf[Pseudo_row++ * Pseudo_cols]; \ + if (memcmp(_ptr, _str, _len)) { \ + memcpy(_ptr, _str, _len); \ + } else { \ +@@ -237,6 +241,11 @@ + RCW_t win [4]; // a 'WIN_t.rc' for each of the 4 windows + } RCF_t; + ++typedef struct PSEUDO_SCREEN_t { ++ char *buf; ++ int mem_size; ++} PSEUDO_SCREEN_t; ++ + // The scaling 'type' used with scale_num() -- this is how + // the passed number is interpreted should scaling be necessary + enum scale_num { --- procps-3.2.7.orig/debian/patches/10_pmap.1.dpatch +++ procps-3.2.7/debian/patches/10_pmap.1.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_pmap.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup pmap.1 manual page #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/pmap.1 procps-3.2.7/pmap.1 +--- procps-3.2.7~/pmap.1 2004-01-29 13:39:08.000000000 +1100 ++++ procps-3.2.7/pmap.1 2006-06-26 11:48:23.000000000 +1000 +@@ -10,25 +10,29 @@ + pmap \- report memory map of a process + + .SH SYNOPSIS +-.nf +-pmap [ -x | -d ] [ -q ] pids... +-pmap -V +-.fi ++.B pmap ++.RB [ \-x | \-d ] ++.RB [ \-q ] ++.I pid ++\& ... ++.br ++.B pmap \-V + + .SH DESCRIPTION + The pmap command reports the memory map of a process or processes. + + .SH "GENERAL OPTIONS" + .TS +-l l l. +--x extended Show the extended format. +--d device Show the device format. +--q quiet Do not display some header/footer lines. +--V show version Displays version of program. ++lB l l. ++\-x extended Show the extended format. ++\-d device Show the device format. ++\-q quiet Do not display some header/footer lines. ++\-V show version Displays version of program. + .TE + + .SH "SEE ALSO" +-ps(1) pgrep(1) ++.BR ps(1), ++.BR pgrep(1) + + .SH STANDARDS + No standards apply, but pmap looks an awful lot like a SunOS command. --- procps-3.2.7.orig/debian/patches/50_top_mintime.dpatch +++ procps-3.2.7/debian/patches/50_top_mintime.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50_top_mintime.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Checks minimum time is valid + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2007-10-04 21:58:56.000000000 +1000 ++++ procps-3.2.7/top.c 2007-10-04 21:59:24.000000000 +1000 +@@ -2535,7 +2535,8 @@ + else { + float tmp = + get_float(fmtmk("Change delay from %.1f to", Rc.delay_time)); +- if (tmp > -1) Rc.delay_time = tmp; ++ if (tmp == 0.0) show_msg("\aNot valid"); ++ else if (tmp > 0) Rc.delay_time = tmp; + } + break; + --- procps-3.2.7.orig/debian/patches/30_library_map_freeproc.dpatch +++ procps-3.2.7/debian/patches/30_library_map_freeproc.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh -e +## 30_library_map_freeproc.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Added freeproc to library.map + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +--- procps-3.2.0.orig/proc/library.map ++++ procps-3.2.0/proc/library.map +@@ -7,7 +7,7 @@ + + readproc; readtask; readproctab; readproctab2; look_up_our_self; escape_command; + escape_str; escape_strlist; +- openproc; closeproc; ++ openproc; closeproc; freeproc; + tty_to_dev; dev_to_tty; open_psdb_message; open_psdb; lookup_wchan; + display_version; procps_version; linux_version_code; + Hertz; smp_num_cpus; --- procps-3.2.7.orig/debian/patches/30_pgrep_start_time.dpatch +++ procps-3.2.7/debian/patches/30_pgrep_start_time.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 30_pgrep_start_time.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: pgrep.c saved_start_time was missed + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +--- procps-3.2.0.orig/pgrep.c ++++ procps-3.2.0/pgrep.c +@@ -367,7 +367,8 @@ + preg = do_regcomp (); + + if (opt_newest) saved_start_time = 0ULL; +- if (opt_oldest) saved_start_time = ~0ULL; ++ else ++ saved_start_time = ~0ULL; + if (opt_newest) saved_pid = 0; + if (opt_oldest) saved_pid = INT_MAX; + --- procps-3.2.7.orig/debian/patches/60_top_nohz.dpatch +++ procps-3.2.7/debian/patches/60_top_nohz.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60_top_nohz.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Handle idle time calculations correctly when running with NOHZ. + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2006-06-25 08:41:48.000000000 +0200 ++++ procps-3.2.7/top.c 2007-07-20 12:50:00.000000000 +0200 +@@ -2886,6 +2886,7 @@ + s_frme = cpu->s - cpu->s_sav; + n_frme = cpu->n - cpu->n_sav; + i_frme = TRIMz(cpu->i - cpu->i_sav); ++ if ((u_frme == 0) && (i_frme == 0)) i_frme = 100.0; + w_frme = cpu->w - cpu->w_sav; + x_frme = cpu->x - cpu->x_sav; + y_frme = cpu->y - cpu->y_sav; --- procps-3.2.7.orig/debian/patches/10_slabtop.dpatch +++ procps-3.2.7/debian/patches/10_slabtop.dpatch @@ -0,0 +1,99 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_slabtop.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup slabtop man page #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/slabtop.1 procps-3.2.7/slabtop.1 +--- procps-3.2.7~/slabtop.1 2006-06-18 15:10:24.000000000 +1000 ++++ procps-3.2.7/slabtop.1 2006-06-26 12:31:42.000000000 +1000 +@@ -7,36 +7,39 @@ + slabtop \- display kernel slab cache information in real time + + .SH SYNOPSIS +-.BI "slabtop [ " options " ] " ++.B slabtop ++.RI [ options ] + + .SH DESCRIPTION +-.BR slabtop (1) ++.B slabtop + displays detailed kernel slab cache information in real time. It displays a + listing of the top caches sorted by one of the listed sort criteria. It also + displays a statistics header filled with slab layer information. + + .SH OPTIONS + Normal invocation of +-.BR slabtop (1) ++.B slabtop + does not require any options. The behavior, however, can be fine-tuned by + specifying one or more of the following flags: + .TP +-.B \-\^\-delay=n, \-d n +-Refresh the display every n seconds. By default, +-.BR slabtop (1) ++.B \-\-delay=\fIn\fR, \fB\-d \fIn ++Refresh the display every ++.I n ++in seconds. By default, ++.B slabtop + refreshes the display every three seconds. To exit the program, hit + .BR q. + .TP +-.B \-\^\-sort=S, \-s S +-Sort by S, where S is one of the sort criteria. ++.B \-\-sort=\fIS\fR, \fB\-s\fR \fIS ++Sort by \fIS\fR, where \fIS\fR is one of the sort criteria. + .TP +-.B \-\^\-once, \-o ++.B \-\-once\fR, \fB\-o + Display the output once and then exit. + .TP +-.B \-\^\-version, \-V ++.B \-\-version\fR, \fB\-V + Display version information and exit. + .TP +-.B \-\^\-help ++.B \-\-help + Display usage information and exit. + + .SH SORT CRITERIA +@@ -78,7 +81,7 @@ + sort by cache utilization + + .SH COMMANDS +-.BR slabtop (1) ++.B slabtop + accepts keyboard commands from the user during use. The following are + supported. In the case of letters, both cases are accepted. + +@@ -94,7 +97,9 @@ + Quit the program. + + .SH FILES +-.IR /proc/slabinfo " \-\- slab information" ++.TP ++.I /proc/slabinfo ++slab information + + .SH "SEE ALSO" + .BR free (1), +@@ -104,7 +109,7 @@ + + .SH NOTES + Currently, +-.BR slabtop (1) ++.B slabtop + requires a 2.4 or later kernel (specifically, a version 1.1 or later + .IR /proc/slabinfo ). + Kernel 2.2 should be supported in the future. +@@ -116,7 +121,7 @@ + .SH AUTHORS + Written by Chris Rivera and Robert Love. + +-.BR slabtop (1) ++.B slabtop + was inspired by Martin Bligh's perl script, + .BR vmtop . + The procps package is maintained by Albert Cahalan . --- procps-3.2.7.orig/debian/patches/30_w-columns.dpatch +++ procps-3.2.7/debian/patches/30_w-columns.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_w-columns.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: use COLUMNS environment if TIOCGWINSZ fails + +@DPATCH@ +diff -urNad --exclude=CVS --exclude=.svn ./w.c /tmp/dpep-work.0retPU/procps-3.2.6/w.c +--- ./w.c 2005-10-31 12:41:33.000000000 +1100 ++++ /tmp/dpep-work.0retPU/procps-3.2.6/w.c 2005-10-31 12:41:55.000000000 +1100 +@@ -231,10 +231,10 @@ + + /***** main */ + int main(int argc, char **argv) { +- char *user = NULL; ++ char *user = NULL, *p; + utmp_t *u; + struct winsize win; +- int header=1, longform=1, from=1, args, maxcmd=80, ch; ++ int header=1, longform=1, from=1, args, maxcmd, ch; + + #ifndef W_SHOWFROM + from = 0; +@@ -267,6 +267,10 @@ + + if (ioctl(1, TIOCGWINSZ, &win) != -1 && win.ws_col > 0) + maxcmd = win.ws_col; ++ else if (p = getenv("COLUMNS")) ++ maxcmd = atoi(p); ++ else ++ maxcmd = 80; + if (maxcmd < 71) { + fprintf(stderr, "%d column window is too narrow\n", maxcmd); + exit(1); --- procps-3.2.7.orig/debian/patches/10_tload.1.dpatch +++ procps-3.2.7/debian/patches/10_tload.1.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_tload.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Reword tload.1 man page for the alarm + +@DPATCH@ +diff -urNad procps-3.2.7~/tload.1 procps-3.2.7/tload.1 +--- procps-3.2.7~/tload.1 2002-10-07 07:26:12.000000000 +1000 ++++ procps-3.2.7/tload.1 2006-06-26 12:44:39.000000000 +1000 +@@ -39,7 +39,7 @@ + .BI "\-d" " delay" + option sets the time argument for an + .BR alarm (2); +-if -d 0 is specified, the alarm is set to 0, which will never send the ++if \-d 0 is specified, the alarm is set to 0, which will never send the + .B SIGALRM + and update the display. + --- procps-3.2.7.orig/debian/patches/10_sysctl_malloclen.dpatch +++ procps-3.2.7/debian/patches/10_sysctl_malloclen.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_sysctl_malloclen.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Adjust malloc length one more Closes: #423704 + +@DPATCH@ +diff -urNad procps-3.2.7~/sysctl.c procps-3.2.7/sysctl.c +--- procps-3.2.7~/sysctl.c 2006-06-25 10:51:51.000000000 +1000 ++++ procps-3.2.7/sysctl.c 2007-05-16 22:37:40.000000000 +1000 +@@ -135,7 +135,7 @@ + } + + /* used to open the file */ +- tmpname = malloc(strlen(name)+strlen(PROC_PATH)+1); ++ tmpname = malloc(strlen(name)+strlen(PROC_PATH)+2); + strcpy(tmpname, PROC_PATH); + strcat(tmpname, name); + slashdot(tmpname+strlen(PROC_PATH),'.','/'); /* change . to / */ --- procps-3.2.7.orig/debian/patches/10_ps.1.dpatch +++ procps-3.2.7/debian/patches/10_ps.1.dpatch @@ -0,0 +1,46 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_ps.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: ps.1 normal indent widths +## DP: pri field explained #465761 +## DP: --no-heading comment is an alias for --no-headers + +@DPATCH@ +diff -urNad procps-3.2.7~/ps/ps.1 procps-3.2.7/ps/ps.1 +--- procps-3.2.7~/ps/ps.1 2008-04-07 09:13:00.000000000 +1000 ++++ procps-3.2.7/ps/ps.1 2008-04-07 09:59:52.000000000 +1000 +@@ -18,12 +18,6 @@ + .nh + .if n .ss 12 0 + .\" +-.\" See /usr/share/groff/current/tmac/an-old.tmac for what these do. +-.\" Setting them to zero provides extra space, but only do that for +-.\" plain text output. PostScript and such will remain indented. +-.if n .nr IN 0n +-.if n .nr an-prevailing-indent 0n +-.\" + .\" + .\" ColSize is used for the format spec table. + .\" It's the left margin, minus the right, minus +@@ -588,7 +582,8 @@ + repeat header lines, one per page of output + + .opt \-\-no\-headers +-print no header line at all ++print no header line at all. \-\-no\-heading is an alias for this ++option. + + .opt \-\-lines \ n + set screen height +@@ -1139,6 +1134,10 @@ + parent process ID. + T} + ++pri PRI T{ ++priority of the process. Higher number means lower priority ++T} ++ + psr PSR T{ + processor that process is currently assigned to. + T} --- procps-3.2.7.orig/debian/patches/20_watch_8bitchar.dpatch +++ procps-3.2.7/debian/patches/20_watch_8bitchar.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_watch_8bitchar.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make char unsigned + +@DPATCH@ +diff -urNad procps-3.2.7~/watch.c procps-3.2.7/watch.c +--- procps-3.2.7~/watch.c 2006-06-17 19:18:38.000000000 +1000 ++++ procps-3.2.7/watch.c 2006-06-26 08:47:57.000000000 +1000 +@@ -297,7 +297,7 @@ + move(y, x); + if (option_differences) { + int oldch = inch(); +- char oldc = oldch & A_CHARTEXT; ++ unsigned char oldc = oldch & A_CHARTEXT; + attr = !first_screen + && (c != oldc + || --- procps-3.2.7.orig/debian/patches/30_tload_no_optargs.dpatch +++ procps-3.2.7/debian/patches/30_tload_no_optargs.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 30_tload_no_optargs.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Removed unneeded optarg and optind variables form tload.c + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +--- procps-3.2.0.orig/tload.c ++++ procps-3.2.0/tload.c +@@ -30,9 +30,6 @@ + static int dly=5; + static jmp_buf jb; + +-extern int optind; +-extern char *optarg; +- + static void alrm(int signo) + { + (void)signo; --- procps-3.2.7.orig/debian/patches/20_kill_warncr.dpatch +++ procps-3.2.7/debian/patches/20_kill_warncr.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_kill_warncr.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add CR to warning line #331419 + +@DPATCH@ +diff -urNad procps-3.2.7~/skill.c procps-3.2.7/skill.c +--- procps-3.2.7~/skill.c 2004-09-09 23:49:38.000000000 +1000 ++++ procps-3.2.7/skill.c 2006-06-26 22:40:17.000000000 +1000 +@@ -128,7 +128,7 @@ + sprintf(buf, "/proc/%d/stat", pid); /* pid (cmd) state ppid pgrp session tty */ + fd = open(buf,O_RDONLY); + if(fd==-1){ /* process exited maybe */ +- if(pids && w_flag) printf("WARNING: process %d could not be found.",pid); ++ if(pids && w_flag) printf("WARNING: process %d could not be found.\n",pid); + return; + } + fstat(fd, &statbuf); +@@ -333,7 +333,7 @@ + }else{ + fprintf(stderr, + "Usage: snice [new priority] [options] process selection criteria\n" +- "Example: snice netscape crack +7\n" ++ "Example: snice +7 netscape crack \n" + "\n" + "The default priority is +4. (snice +4 ...)\n" + "Priority numbers range from +20 (slowest) to -20 (fastest).\n" --- procps-3.2.7.orig/debian/patches/40_pgrep_coption.dpatch +++ procps-3.2.7/debian/patches/40_pgrep_coption.dpatch @@ -0,0 +1,87 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40_pgrep-coption.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: c option for pgrep for counting number of matched proceesses + +@DPATCH@ +diff -urNad procps-3.2.7~/pgrep.1 procps-3.2.7/pgrep.1 +--- procps-3.2.7~/pgrep.1 2007-10-05 22:32:40.000000000 +1000 ++++ procps-3.2.7/pgrep.1 2007-10-05 22:36:42.000000000 +1000 +@@ -7,7 +7,7 @@ + pgrep, pkill \- look up or signal processes based on name and other attributes + + .SH SYNOPSIS +-pgrep [\-flvx] [\-d \fIdelimiter\fP] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...] ++pgrep [\-cflvx] [\-d \fIdelimiter\fP] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...] + .br + [\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...] + .br +@@ -38,6 +38,9 @@ + + .SH OPTIONS + .TP ++\-c ++Suppress normal output; instead print a count of matching processes. ++.TP + \-d \fIdelimiter\fP + Sets the string used to delimit each process ID in the output (by + default a newline). (\fBpgrep\fP only.) +diff -urNad procps-3.2.7~/pgrep.c procps-3.2.7/pgrep.c +--- procps-3.2.7~/pgrep.c 2007-10-05 22:35:52.000000000 +1000 ++++ procps-3.2.7/pgrep.c 2007-10-05 22:35:52.000000000 +1000 +@@ -54,6 +54,7 @@ + static int opt_newest = 0; + static int opt_negate = 0; + static int opt_exact = 0; ++static int opt_count = 0; + static int opt_signal = SIGTERM; + static int opt_lock = 0; + static int opt_case = 0; +@@ -77,7 +78,7 @@ + if (i_am_pkill) + fprintf (stderr, "Usage: pkill [-SIGNAL] [-fvx] "); + else +- fprintf (stderr, "Usage: pgrep [-flvx] [-d DELIM] "); ++ fprintf (stderr, "Usage: pgrep [-cflvx] [-d DELIM] "); + fprintf (stderr, "[-n|-o] [-P PPIDLIST] [-g PGRPLIST] [-s SIDLIST]\n" + "\t[-u EUIDLIST] [-U UIDLIST] [-G GIDLIST] [-t TERMLIST] " + "[PATTERN]\n"); +@@ -562,7 +563,7 @@ + strcat (opts, "ld:"); + } + +- strcat (opts, "LF:fnovxP:g:s:u:U:G:t:?V"); ++ strcat (opts, "LF:cfnovxP:g:s:u:U:G:t:?V"); + + while ((opt = getopt (argc, argv, opts)) != -1) { + switch (opt) { +@@ -610,6 +611,9 @@ + exit(EXIT_SUCCESS); + // case 'c': // Solaris: match by contract ID + // break; ++ case 'c': ++ opt_count = 1; ++ break; + case 'd': // Solaris: change the delimiter + opt_delim = strdup (optarg); + break; +@@ -721,10 +725,14 @@ + procs[i].num, strerror (errno)); + } + } else { +- if (opt_long) +- output_strlist(procs,num); +- else +- output_numlist(procs,num); ++ if (opt_count) { ++ fprintf(stdout, "%ld\n", num); ++ } else { ++ if (opt_long) ++ output_strlist (procs,num); ++ else ++ output_numlist (procs,num); ++ } + } + return !num; // exit(EXIT_SUCCESS) if match, otherwise exit(EXIT_FAILURE) + } --- procps-3.2.7.orig/debian/patches/30_w.1.dpatch +++ procps-3.2.7/debian/patches/30_w.1.dpatch @@ -0,0 +1,73 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_w.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleaned up the w man page +## DP: Make note of the time formats #414906 + +@DPATCH@ +diff -urNad procps-3.2.7~/w.1 procps-3.2.7/w.1 +--- procps-3.2.7~/w.1 2009-01-09 16:26:36.000000000 +1100 ++++ procps-3.2.7/w.1 2009-01-09 16:33:16.000000000 +1100 +@@ -4,26 +4,26 @@ + .SH NAME + w \- Show who is logged on and what they are doing. + .SH SYNOPSIS +-.B w \- +-.RB [ husfVo ] ++.B w ++.RB [ \-husfVo ] + .RI [ user ] + .SH DESCRIPTION +-.B "w " ++.B w + displays information about the users currently on the machine, + and their processes. + The header shows, in this order, the current time, + how long the system has been running, + how many users are currently logged on, + and the system load averages for the past 1, 5, and 15 minutes. +-.sp ++ + The following entries are displayed for each user: + login name, the tty name, the remote host, login time, idle time, JCPU, PCPU, + and the command line of their current process. +-.sp ++ + The JCPU time is the time used by all processes attached to the tty. It + does not include past background jobs, but does include currently + running background jobs. +-.sp ++ + The PCPU time is the time used by the current process, named in the "what" + field. + +@@ -35,7 +35,7 @@ + .TP 0.5i + .B "\-u " + Ignores the username while figuring out the current process and cpu +-times. To demonstrate this, do a "su" and do a "w" and a "w -u". ++times. To demonstrate this, do a "su" and do a "w" and a "w \-u". + .TP 0.5i + .B "\-s " + Use the short format. +@@ -70,6 +70,19 @@ + process information + .PP + ++.SH NOTES ++The output for Idle, JCPU and PCPU times vaires depending on if you use ++the \-o (old style) option or not. These formats can be confusing if you ++switch between the old style and standard. In the following paragraphs ++days are DD, hours HH, minutes MM, seconds SS and 100ths of seconds CC. ++ ++The standard format is DDdays, HH:MMm, MM:SS or SS.CC if the times are ++greater than 2 days, 1hour, or 1 minute respectively. ++ ++For the \-o option, the output will be either DDdays, HH:MM, MM:SSm or ++blank if the times are greater than 2 days, 1 hour or 1 minute ++respectively. ++ + .SH "SEE ALSO" + .BR free (1), + .BR ps (1), --- procps-3.2.7.orig/debian/patches/10_output_sort_time.dpatch +++ procps-3.2.7/debian/patches/10_output_sort_time.dpatch @@ -0,0 +1,2059 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_output_sort_time.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: More ps time sorting #508435 + +@DPATCH@ +diff -urNad procps-3.2.7~/ps/output.c procps-3.2.7/ps/output.c +--- procps-3.2.7~/ps/output.c 2006-06-19 09:27:02.000000000 +1000 ++++ procps-3.2.7/ps/output.c 2009-01-07 17:52:09.000000000 +1100 +@@ -110,6 +110,20 @@ + return (int)(P->NAME) - (int)(Q->NAME); \ + } + ++#define cook_time(P) (P->utime + P->stime) / Hertz ++ ++#define cook_etime(P) seconds_since_boot - (unsigned long)(P->start_time / Hertz) ++ ++#define CMP_COOKED_TIME(NAME) \ ++static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \ ++ unsigned long p_time,q_time; \ ++ p_time=cook_ ##NAME (P); \ ++ q_time=cook_ ##NAME (Q); \ ++ if (p_time < q_time) return -1; \ ++ if (p_time > q_time) return 1; \ ++ return 0; \ ++} ++ + CMP_INT(rtprio) + CMP_SMALL(sched) + CMP_INT(cutime) +@@ -185,6 +199,9 @@ + + CMP_SMALL(state) + ++CMP_COOKED_TIME(time) ++CMP_COOKED_TIME(etime) ++ + /* approximation to: kB of address space that could end up in swap */ + static int sr_swapable(const proc_t* P, const proc_t* Q) { + unsigned long p_swapable = P->vm_data + P->vm_stack; +@@ -408,7 +425,7 @@ + unsigned long t; + unsigned dd,hh,mm,ss; + char *cp = outbuf; +- t = seconds_since_boot - (unsigned long)(pp->start_time / Hertz); ++ t = cook_etime(pp); + ss = t%60; + t /= 60; + mm = t%60; +@@ -476,7 +493,7 @@ + unsigned long t; + unsigned dd,hh,mm,ss; + int c; +- t = (pp->utime + pp->stime) / Hertz; ++ t = cook_time(pp); + ss = t%60; + t /= 60; + mm = t%60; +@@ -1277,7 +1294,7 @@ + {"alarm", "ALARM", pr_alarm, sr_alarm, 5, 0, LNX, AN|RIGHT}, + {"argc", "ARGC", pr_nop, sr_nop, 4, 0, LNX, PO|RIGHT}, + {"args", "COMMAND", pr_args, sr_cmd, 27, ARG, U98, PO|UNLIMITED}, /*command*/ +-{"atime", "TIME", pr_time, sr_nop, 8, 0, SOE, ET|RIGHT}, /*cputime*/ /* was 6 wide */ ++{"atime", "TIME", pr_time, sr_time, 8, 0, SOE, ET|RIGHT}, /*cputime*/ /* was 6 wide */ + {"blocked", "BLOCKED", pr_sigmask, sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigmask*/ + {"bnd", "BND", pr_nop, sr_nop, 1, 0, AIX, TO|RIGHT}, + {"bsdstart", "START", pr_bsdstart, sr_nop, 6, 0, LNX, ET|RIGHT}, +@@ -1296,7 +1313,7 @@ + {"cp", "CP", pr_cp, sr_pcpu, 3, 0, DEC, ET|RIGHT}, /*cpu*/ + {"cpu", "CPU", pr_nop, sr_nop, 3, 0, BSD, AN|RIGHT}, /* FIXME ... HP-UX wants this as the CPU number for SMP? */ + {"cpuid", "CPUID", pr_psr, sr_nop, 5, 0, BSD, TO|RIGHT}, // OpenBSD: 8 wide! +-{"cputime", "TIME", pr_time, sr_nop, 8, 0, DEC, ET|RIGHT}, /*time*/ ++{"cputime", "TIME", pr_time, sr_time, 8, 0, DEC, ET|RIGHT}, /*time*/ + {"cstime", "-", pr_nop, sr_cstime, 1, 0, LNX, AN|RIGHT}, + {"ctid", "CTID", pr_nop, sr_nop, 5, 0, SUN, ET|RIGHT}, // resource contracts? + {"cursig", "CURSIG", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT}, +@@ -1311,7 +1328,7 @@ + {"end_code", "E_CODE", pr_nop, sr_end_code, 8, 0, LNx, PO|RIGHT}, + {"environ","ENVIRONMENT",pr_nop, sr_nop, 11, ENV, LNx, PO|UNLIMITED}, + {"esp", "ESP", pr_esp, sr_kstk_esp, 8, 0, LNX, TO|RIGHT}, +-{"etime", "ELAPSED", pr_etime, sr_nop, 11, 0, U98, ET|RIGHT}, /* was 7 wide */ ++{"etime", "ELAPSED", pr_etime, sr_etime, 11, 0, U98, ET|RIGHT}, /* was 7 wide */ + {"euid", "EUID", pr_euid, sr_euid, 5, 0, LNX, ET|RIGHT}, + {"euser", "EUSER", pr_euser, sr_euser, 8, USR, LNX, ET|USER}, + {"f", "F", pr_flag, sr_flags, 1, 0, XXX, ET|RIGHT}, /*flags*/ +@@ -1455,7 +1472,7 @@ + {"tdev", "TDEV", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT}, + {"thcount", "THCNT", pr_nlwp, sr_nlwp, 5, 0, AIX, PO|RIGHT}, + {"tid", "TID", pr_thread, sr_tid, 5, 0, AIX, TO|PIDMAX|RIGHT}, +-{"time", "TIME", pr_time, sr_nop, 8, 0, U98, ET|RIGHT}, /*cputime*/ /* was 6 wide */ ++{"time", "TIME", pr_time, sr_time, 8, 0, U98, ET|RIGHT}, /*cputime*/ /* was 6 wide */ + {"timeout", "TMOUT", pr_nop, sr_nop, 5, 0, LNX, AN|RIGHT}, // 2.0.xx era + {"tmout", "TMOUT", pr_nop, sr_nop, 5, 0, LNX, AN|RIGHT}, // 2.0.xx era + {"tname", "TTY", pr_tty8, sr_tty, 8, 0, DEC, PO|LEFT}, +diff -urNad procps-3.2.7~/ps/output.c.orig procps-3.2.7/ps/output.c.orig +--- procps-3.2.7~/ps/output.c.orig 1970-01-01 10:00:00.000000000 +1000 ++++ procps-3.2.7/ps/output.c.orig 2006-06-19 09:27:02.000000000 +1000 +@@ -0,0 +1,1960 @@ ++/* ++ * Copyright 1999-2004 by Albert Cahalan; all rights reserved. ++ * ++ * This file may be used subject to the terms and conditions of the ++ * GNU Library General Public License Version 2, or any later version ++ * at your option, as published by the Free Software Foundation. ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU Library General Public License for more details. ++ */ ++ ++/* ++ * This file is really gross, and I know it. I looked into several ++ * alternate ways to deal with the mess, and they were all ugly. ++ * ++ * FreeBSD has a fancy hack using offsets into a struct -- that ++ * saves code but it is _really_ gross. See the PO macro below. ++ * ++ * We could have a second column width for wide output format. ++ * For example, Digital prints the real-time signals. ++ */ ++ ++ ++/* ++ * Data table idea: ++ * ++ * table 1 maps aix to specifier ++ * table 2 maps shortsort to specifier ++ * table 3 maps macro to specifiers ++ * table 4 maps specifier to title,datatype,offset,vendor,helptext ++ * table 5 maps datatype to justification,width,widewidth,sorting,printing ++ * ++ * Here, "datatype" could be user,uid,u16,pages,deltaT,signals,tty,longtty... ++ * It must be enough to determine printing and sorting. ++ * ++ * After the tables, increase width as needed to fit the header. ++ * ++ * Table 5 could go in a file with the output functions. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "../proc/readproc.h" ++#include "../proc/sysinfo.h" ++#include "../proc/wchan.h" ++#include "../proc/procps.h" ++#include "../proc/devname.h" ++#include "../proc/escape.h" ++#include "common.h" ++ ++/* TODO: ++ * Stop assuming system time is local time. ++ */ ++ ++#define COLWID 240 /* satisfy snprintf, which is faster than sprintf */ ++ ++static unsigned max_rightward = 0x12345678; /* space for RIGHT stuff */ ++static unsigned max_leftward = 0x12345678; /* space for LEFT stuff */ ++ ++ ++ ++static int wide_signals; /* true if we have room */ ++ ++static unsigned long seconds_since_1970; ++static unsigned long time_of_boot; ++static unsigned long page_shift; ++ ++ ++/*************************************************************************/ ++/************ Lots of sort functions, starting with the NOP **************/ ++ ++static int sr_nop(const proc_t* a, const proc_t* b){ ++ (void)a;(void)b; /* shut up gcc */ ++ return 0; ++} ++ ++#define CMP_STR(NAME) \ ++static int sr_ ## NAME(const proc_t* P, const proc_t* Q) { \ ++ return strcmp(P->NAME, Q->NAME); \ ++} ++ ++#define CMP_INT(NAME) \ ++static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \ ++ if (P->NAME < Q->NAME) return -1; \ ++ if (P->NAME > Q->NAME) return 1; \ ++ return 0; \ ++} ++ ++/* fast version, for values which either: ++ * a. differ by no more than 0x7fffffff ++ * b. only need to be grouped same w/ same ++ */ ++#define CMP_SMALL(NAME) \ ++static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \ ++ return (int)(P->NAME) - (int)(Q->NAME); \ ++} ++ ++CMP_INT(rtprio) ++CMP_SMALL(sched) ++CMP_INT(cutime) ++CMP_INT(cstime) ++CMP_SMALL(priority) /* nice */ ++CMP_SMALL(nlwp) ++CMP_SMALL(nice) /* priority */ ++CMP_INT(rss) /* resident set size from stat file */ /* vm_rss, resident */ ++CMP_INT(alarm) ++CMP_INT(size) /* total pages */ /* vm_size, vsize */ ++CMP_INT(resident) /* resident pages */ /* vm_rss, rss */ ++CMP_INT(share) /* shared pages */ ++CMP_INT(trs) /* executable pages */ ++CMP_INT(lrs) /* obsolete "library" pages above 0x60000000 */ ++CMP_INT(drs) /* other pages (assumed data?) */ ++CMP_INT(dt) /* dirty pages */ ++ ++CMP_INT(vm_size) /* kB VM */ /* size, vsize */ ++CMP_INT(vm_lock) /* kB locked */ ++CMP_INT(vm_rss) /* kB rss */ /* rss, resident */ ++CMP_INT(vm_data) /* kB "data" == data-stack */ ++CMP_INT(vm_stack) /* kB stack */ ++CMP_INT(vm_exe) /* kB "exec" == exec-lib */ ++CMP_INT(vm_lib) /* kB "libraries" */ ++CMP_INT(vsize) /* pages VM */ /* size, vm_size */ ++CMP_INT(rss_rlim) ++CMP_SMALL(flags) ++CMP_INT(min_flt) ++CMP_INT(maj_flt) ++CMP_INT(cmin_flt) ++CMP_INT(cmaj_flt) ++CMP_INT(utime) ++CMP_INT(stime) /* Old: sort by systime. New: show start time. Uh oh. */ ++CMP_INT(start_code) ++CMP_INT(end_code) ++CMP_INT(start_stack) ++CMP_INT(kstk_esp) ++CMP_INT(kstk_eip) ++CMP_INT(start_time) ++CMP_INT(wchan) ++ ++/* CMP_STR(*environ) */ ++/* CMP_STR(*cmdline) */ ++ ++CMP_STR(ruser) ++CMP_STR(euser) ++CMP_STR(suser) ++CMP_STR(fuser) ++CMP_STR(rgroup) ++CMP_STR(egroup) ++CMP_STR(sgroup) ++CMP_STR(fgroup) ++CMP_STR(cmd) ++/* CMP_STR(ttyc) */ /* FIXME -- use strncmp with 8 max */ ++ ++CMP_INT(ruid) ++CMP_INT(rgid) ++CMP_INT(euid) ++CMP_INT(egid) ++CMP_INT(suid) ++CMP_INT(sgid) ++CMP_INT(fuid) ++CMP_INT(fgid) ++CMP_SMALL(tid) ++CMP_SMALL(tgid) ++CMP_SMALL(ppid) ++CMP_SMALL(pgrp) ++CMP_SMALL(session) ++CMP_INT(tty) ++CMP_SMALL(tpgid) ++ ++CMP_SMALL(pcpu) ++ ++CMP_SMALL(state) ++ ++/* approximation to: kB of address space that could end up in swap */ ++static int sr_swapable(const proc_t* P, const proc_t* Q) { ++ unsigned long p_swapable = P->vm_data + P->vm_stack; ++ unsigned long q_swapable = Q->vm_data + Q->vm_stack; ++ if (p_swapable < q_swapable) return -1; ++ if (p_swapable > q_swapable) return 1; ++ return 0; ++} ++ ++ ++/***************************************************************************/ ++/************ Lots of format functions, starting with the NOP **************/ ++ ++// so popular it can't be "static" ++int pr_nop(char *restrict const outbuf, const proc_t *restrict const pp){ ++ (void)pp; ++ return snprintf(outbuf, COLWID, "%c", '-'); ++} ++ ++ ++/********* Unix 98 ************/ ++ ++/*** ++ ++Only comm and args are allowed to contain blank characters; all others are ++not. Any implementation-dependent variables will be specified in the system ++documentation along with the default header and indicating if the field ++may contain blank characters. ++ ++Some headers do not have a standardized specifier! ++ ++%CPU pcpu The % of cpu time used recently, with unspecified "recently". ++ADDR The address of the process. ++C Processor utilisation for scheduling. ++CMD The command name, or everything with -f. ++COMMAND args Command + args. May chop as desired. May use either version. ++COMMAND comm argv[0] ++ELAPSED etime Elapsed time since the process was started. [[dd-]hh:]mm:ss ++F Flags (octal and additive) ++GROUP group Effective group ID, prefer text over decimal. ++NI nice Decimal system scheduling priority, see nice(1). ++PGID pgid The decimal value of the process group ID. ++PID pid Decimal PID. ++PPID ppid Decimal PID. ++PRI Priority. Higher numbers mean lower priority. ++RGROUP rgroup Real group ID, prefer text over decimal. ++RUSER ruser Real user ID, prefer text over decimal. ++S The state of the process. ++STIME Starting time of the process. ++SZ The size in blocks of the core image of the process. ++TIME time Cumulative CPU time. [dd-]hh:mm:ss ++TT tty Name of tty in format used by who(1). ++TTY The controlling terminal for the process. ++UID UID, or name when -f ++USER user Effective user ID, prefer text over decimal. ++VSZ vsz Virtual memory size in decimal kB. ++WCHAN Where waiting/sleeping or blank if running. ++ ++The nice value is used to compute the priority. ++ ++For some undefined ones, Digital does: ++ ++F flag Process flags -- but in hex! ++PRI pri Process priority ++S state Symbolic process status ++TTY tt,tty,tname,longtname -- all do "ttyp1", "console", "??" ++UID uid Process user ID (effective UID) ++WCHAN wchan Address of event on which a ++ ++For some undefined ones, Sun does: ++ ++ADDR addr memory address of the process ++C c Processor utilization for scheduling (obsolete). ++CMD ++F f ++S s state: OSRZT ++STIME start time, printed w/o blanks. If 24h old, months & days ++SZ size (in pages) of the swappable process's image in main memory ++TTY ++UID uid ++WCHAN wchan ++ ++For some undefined ones, SCO does: ++ADDR addr Virtual address of the process' entry in the process table. ++SZ swappable size in kB of the virtual data and stack ++STIME stime hms or md time format ++***/ ++ ++/* Source & destination are known. Return bytes or screen characters? */ ++static int forest_helper(char *restrict const outbuf){ ++ char *p = forest_prefix; ++ char *q = outbuf; ++ int rightward=max_rightward; ++ if(!*p) return 0; ++ /* Arrrgh! somebody defined unix as 1 */ ++ if(forest_type == 'u') goto unixy; ++ while(*p){ ++ switch(*p){ ++ case ' ': strcpy(q, " "); break; ++ case 'L': strcpy(q, " \\_ "); break; ++ case '+': strcpy(q, " \\_ "); break; ++ case '|': strcpy(q, " | "); break; ++ case '\0': return q-outbuf; /* redundant & not used */ ++ } ++ if (rightward-4 < 0) { ++ *(q+rightward)='\0'; ++ return max_rightward; ++ } ++ q += 4; ++ rightward -= 4; ++ p++; ++ } ++ return q-outbuf; /* gcc likes this here */ ++unixy: ++ while(*p){ ++ switch(*p){ ++ case ' ': strcpy(q, " "); break; ++ case 'L': strcpy(q, " "); break; ++ case '+': strcpy(q, " "); break; ++ case '|': strcpy(q, " "); break; ++ case '\0': return q-outbuf; /* redundant & not used */ ++ } ++ if (rightward-2 < 0) { ++ *(q+rightward)='\0'; ++ return max_rightward; ++ } ++ q += 2; ++ rightward -= 2; ++ p++; ++ } ++ return q-outbuf; /* gcc likes this here */ ++} ++ ++ ++/* XPG4-UNIX, according to Digital: ++The "args" and "command" specifiers show what was passed to the command. ++Modifications to the arguments are not shown. ++*/ ++ ++/* ++ * pp->cmd short accounting name (comm & ucomm) ++ * pp->cmdline long name with args (args & command) ++ * pp->environ environment ++ */ ++ ++// FIXME: some of these may hit the guard page in forest mode ++ ++/* "command" is the same thing: long unless c */ ++static int pr_args(char *restrict const outbuf, const proc_t *restrict const pp){ ++ char *endp = outbuf; ++ unsigned flags; ++ int rightward=max_rightward; ++ ++ if(forest_prefix){ ++ int fh = forest_helper(outbuf); ++ endp += fh; ++ rightward -= fh; ++ } ++ if(bsd_c_option) flags = ESC_DEFUNCT; ++ else flags = ESC_DEFUNCT | ESC_BRACKETS | ESC_ARGS; ++ endp += escape_command(endp, pp, OUTBUF_SIZE, &rightward, flags); ++ ++ if(bsd_e_option && rightward>1){ ++ const char **env = (const char**)pp->environ; ++ if(env && *env){ ++ *endp++ = ' '; ++ rightward--; ++ endp += escape_strlist(endp, env, OUTBUF_SIZE, &rightward); ++ } ++ } ++ //return endp - outbuf; ++ return max_rightward-rightward; ++} ++ ++/* "ucomm" is the same thing: short unless -f */ ++static int pr_comm(char *restrict const outbuf, const proc_t *restrict const pp){ ++ char *endp = outbuf; ++ unsigned flags; ++ int rightward=max_rightward; ++ ++ if(forest_prefix){ ++ int fh = forest_helper(outbuf); ++ endp += fh; ++ rightward -= fh; ++ } ++ if(unix_f_option) flags = ESC_DEFUNCT | ESC_BRACKETS | ESC_ARGS; ++ else flags = ESC_DEFUNCT; ++ endp += escape_command(endp, pp, OUTBUF_SIZE, &rightward, flags); ++ ++ if(bsd_e_option && rightward>1){ ++ const char **env = (const char**)pp->environ; ++ if(env && *env){ ++ *endp++ = ' '; ++ rightward--; ++ endp += escape_strlist(endp, env, OUTBUF_SIZE, &rightward); ++ } ++ } ++ //return endp - outbuf; ++ return max_rightward-rightward; ++} ++/* Non-standard, from SunOS 5 */ ++static int pr_fname(char *restrict const outbuf, const proc_t *restrict const pp){ ++ char *endp = outbuf; ++ int rightward = max_rightward; ++ ++ if(forest_prefix){ ++ int fh = forest_helper(outbuf); ++ endp += fh; ++ rightward -= fh; ++ } ++ if (rightward>8) /* 8=default, but forest maybe feeds more */ ++ rightward = 8; ++ ++ endp += escape_str(endp, pp->cmd, OUTBUF_SIZE, &rightward); ++ //return endp - outbuf; ++ return max_rightward-rightward; ++} ++ ++/* elapsed wall clock time, [[dd-]hh:]mm:ss format (not same as "time") */ ++static int pr_etime(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long t; ++ unsigned dd,hh,mm,ss; ++ char *cp = outbuf; ++ t = seconds_since_boot - (unsigned long)(pp->start_time / Hertz); ++ ss = t%60; ++ t /= 60; ++ mm = t%60; ++ t /= 60; ++ hh = t%24; ++ t /= 24; ++ dd = t; ++ cp +=( dd ? snprintf(cp, COLWID, "%u-", dd) : 0 ); ++ cp +=( (dd || hh) ? snprintf(cp, COLWID, "%02u:", hh) : 0 ); ++ cp += snprintf(cp, COLWID, "%02u:%02u", mm, ss) ; ++ return (int)(cp-outbuf); ++} ++ ++/* "Processor utilisation for scheduling." --- we use %cpu w/o fraction */ ++static int pr_c(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long long total_time; /* jiffies used by this process */ ++ unsigned pcpu = 0; /* scaled %cpu, 99 means 99% */ ++ unsigned long long seconds; /* seconds of process life */ ++ total_time = pp->utime + pp->stime; ++ if(include_dead_children) total_time += (pp->cutime + pp->cstime); ++ seconds = seconds_since_boot - pp->start_time / Hertz; ++ if(seconds) pcpu = (total_time * 100ULL / Hertz) / seconds; ++ if (pcpu > 99U) pcpu = 99U; ++ return snprintf(outbuf, COLWID, "%2u", pcpu); ++} ++/* normal %CPU in ##.# format. */ ++static int pr_pcpu(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long long total_time; /* jiffies used by this process */ ++ unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */ ++ unsigned long long seconds; /* seconds of process life */ ++ total_time = pp->utime + pp->stime; ++ if(include_dead_children) total_time += (pp->cutime + pp->cstime); ++ seconds = seconds_since_boot - pp->start_time / Hertz; ++ if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds; ++ if (pcpu > 999U) ++ return snprintf(outbuf, COLWID, "%u", pcpu/10U); ++ return snprintf(outbuf, COLWID, "%u.%u", pcpu/10U, pcpu%10U); ++} ++/* this is a "per-mill" format, like %cpu with no decimal point */ ++static int pr_cp(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long long total_time; /* jiffies used by this process */ ++ unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */ ++ unsigned long long seconds; /* seconds of process life */ ++ total_time = pp->utime + pp->stime; ++ if(include_dead_children) total_time += (pp->cutime + pp->cstime); ++ seconds = seconds_since_boot - pp->start_time / Hertz ; ++ if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds; ++ if (pcpu > 999U) pcpu = 999U; ++ return snprintf(outbuf, COLWID, "%3u", pcpu); ++} ++ ++static int pr_pgid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%u", pp->pgrp); ++} ++static int pr_pid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%u", pp->tgid); ++} ++static int pr_ppid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%u", pp->ppid); ++} ++ ++ ++/* cumulative CPU time, [dd-]hh:mm:ss format (not same as "etime") */ ++static int pr_time(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long t; ++ unsigned dd,hh,mm,ss; ++ int c; ++ t = (pp->utime + pp->stime) / Hertz; ++ ss = t%60; ++ t /= 60; ++ mm = t%60; ++ t /= 60; ++ hh = t%24; ++ t /= 24; ++ dd = t; ++ c =( dd ? snprintf(outbuf, COLWID, "%u-", dd) : 0 ); ++ c +=( snprintf(outbuf+c, COLWID, "%02u:%02u:%02u", hh, mm, ss) ); ++ return c; ++} ++ ++/* HP-UX puts this (I forget, vsz or vsize?) in kB and uses "sz" for pages. ++ * Unix98 requires "vsz" to be kB. ++ * Tru64 does both vsize and vsz like "1.23M" ++ * ++ * Our pp->vm_size is kB and our pp->vsize is pages. ++ * ++ * TODO: add flag for "1.23M" behavior, on this and other columns. ++ */ ++static int pr_vsz(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%lu", pp->vm_size); ++} ++ ++////////////////////////////////////////////////////////////////////////////////////// ++ ++// "PRI" is created by "opri", or by "pri" when -c is used. ++// ++// Unix98 only specifies that a high "PRI" is low priority. ++// Sun and SCO add the -c behavior. Sun defines "pri" and "opri". ++// Linux may use "priority" for historical purposes. ++// ++// According to the kernel's fs/proc/array.c and kernel/sched.c source, ++// the kernel reports it in /proc via this: ++// p->prio - MAX_RT_PRIO ++// such that "RT tasks are offset by -200. Normal tasks are centered ++// around 0, value goes from -16 to +15" but who knows if that is ++// before or after the conversion... ++// ++// says: ++// MAX_RT_PRIO is currently 100. (so we see 0 in /proc) ++// RT tasks have a p->prio of 0 to 99. (so we see -100 to -1) ++// non-RT tasks are from 100 to 139. (so we see 0 to 39) ++// Lower values have higher priority, as in the UNIX standard. ++// ++// In any case, pp->priority+100 should get us back to what the kernel ++// has for p->prio. ++// ++// Test results with the "yes" program on a 2.6.x kernel: ++// ++// # ps -C19,_20 -o pri,opri,intpri,priority,ni,pcpu,pid,comm ++// PRI PRI PRI PRI NI %CPU PID COMMAND ++// 0 99 99 39 19 10.6 8686 19 ++// 34 65 65 5 -20 94.7 8687 _20 ++// ++// Grrr. So the UNIX standard "PRI" must NOT be from "pri". ++// Either of the others will do. We use "opri" for this. ++// (and use "pri" when the "-c" option is used) ++// Probably we should have Linux-specific "pri_for_l" and "pri_for_lc" ++// ++// sched_get_priority_min.2 says the Linux static priority is ++// 1..99 for RT and 0 for other... maybe 100 is kernel-only? ++// ++// A nice range would be -99..0 for RT and 1..40 for normal, ++// which is pp->priority+1. (3-digit max, positive is normal, ++// negative or 0 is RT, and meets the standard for PRI) ++// ++ ++// legal as UNIX "PRI" ++// "priority" (was -20..20, now -100..39) ++static int pr_priority(char *restrict const outbuf, const proc_t *restrict const pp){ /* -20..20 */ ++ return snprintf(outbuf, COLWID, "%ld", pp->priority); ++} ++ ++// legal as UNIX "PRI" ++// "intpri" and "opri" (was 39..79, now -40..99) ++static int pr_opri(char *restrict const outbuf, const proc_t *restrict const pp){ /* 39..79 */ ++ return snprintf(outbuf, COLWID, "%ld", 60 + pp->priority); ++} ++ ++// legal as UNIX "PRI" ++// "pri_foo" -- match up w/ nice values of sleeping processes (-120..19) ++static int pr_pri_foo(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", pp->priority - 20); ++} ++ ++// legal as UNIX "PRI" ++// "pri_bar" -- makes RT pri show as negative (-99..40) ++static int pr_pri_bar(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", pp->priority + 1); ++} ++ ++// legal as UNIX "PRI" ++// "pri_baz" -- the kernel's ->prio value, as of Linux 2.6.8 (1..140) ++static int pr_pri_baz(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", pp->priority + 100); ++} ++ ++ ++// not legal as UNIX "PRI" ++// "pri" (was 20..60, now 0..139) ++static int pr_pri(char *restrict const outbuf, const proc_t *restrict const pp){ /* 20..60 */ ++ return snprintf(outbuf, COLWID, "%ld", 39 - pp->priority); ++} ++ ++// not legal as UNIX "PRI" ++// "pri_api" -- match up w/ RT API (-40..99) ++static int pr_pri_api(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", -1 - pp->priority); ++} ++ ++static int pr_nice(char *restrict const outbuf, const proc_t *restrict const pp){ ++ if(pp->sched!=0 && pp->sched!=-1) return snprintf(outbuf, COLWID, "-"); ++ return snprintf(outbuf, COLWID, "%ld", pp->nice); ++} ++ ++// HP-UX "cls": RT RR RR2 ???? HPUX FIFO KERN ++// Solaris "class": SYS TS FX IA RT FSS (FIFO is RR w/ Inf quant) ++// FIFO+RR share RT; FIFO has Inf quant ++// IA=interactive; FX=fixed; TS=timeshare; SYS=system ++// FSS=fairshare; INTS=interrupts ++// Tru64 "policy": FF RR TS ++// IRIX "class": RT TS B BC WL GN ++// RT=real-time; TS=time-share; B=batch; BC=batch-critical ++// WL=weightless; GN=gang-scheduled ++// see miser(1) for this; PRI has some letter codes too ++static int pr_class(char *restrict const outbuf, const proc_t *restrict const pp){ ++ switch(pp->sched){ ++ case -1: return snprintf(outbuf, COLWID, "-"); // not reported ++ case 0: return snprintf(outbuf, COLWID, "TS"); // SCHED_OTHER ++ case 1: return snprintf(outbuf, COLWID, "FF"); // SCHED_FIFO ++ case 2: return snprintf(outbuf, COLWID, "RR"); // SCHED_RR ++ case 3: return snprintf(outbuf, COLWID, "B"); // SCHED_BATCH? (will be "B") ++ case 4: return snprintf(outbuf, COLWID, "#4"); // SCHED_ISO? (Con Kolivas) ++ case 5: return snprintf(outbuf, COLWID, "#5"); // ++ case 8: return snprintf(outbuf, COLWID, "#8"); // ++ default: return snprintf(outbuf, COLWID, "?"); // unknown value ++ } ++} ++// Based on "type", FreeBSD would do: ++// REALTIME "real:%u", prio ++// NORMAL "normal" ++// IDLE "idle:%u", prio ++// default "%u:%u", type, prio ++// We just print the priority, and have other keywords for type. ++static int pr_rtprio(char *restrict const outbuf, const proc_t *restrict const pp){ ++ if(pp->sched==0 || pp->sched==-1) return snprintf(outbuf, COLWID, "-"); ++ return snprintf(outbuf, COLWID, "%ld", pp->rtprio); ++} ++static int pr_sched(char *restrict const outbuf, const proc_t *restrict const pp){ ++ if(pp->sched==-1) return snprintf(outbuf, COLWID, "-"); ++ return snprintf(outbuf, COLWID, "%ld", pp->sched); ++} ++ ++//////////////////////////////////////////////////////////////////////////////// ++ ++static int pr_wchan(char *restrict const outbuf, const proc_t *restrict const pp){ ++/* ++ * Unix98 says "blank if running" and also "no blanks"! :-( ++ * Unix98 also says to use '-' if something is meaningless. ++ * Digital uses both '*' and '-', with undocumented differences. ++ * (the '*' for -1 (rare) and the '-' for 0) ++ * Sun claims to use a blank AND use '-', in the same man page. ++ * Perhaps "blank" should mean '-'. ++ * ++ * AIX uses '-' for running processes, the location when there is ++ * only one thread waiting in the kernel, and '*' when there is ++ * more than one thread waiting in the kernel. ++ * ++ * The output should be truncated to maximal columns width -- overflow ++ * is not supported for the "wchan". ++ */ ++ const char *w; ++ size_t len; ++ if(!(pp->wchan & 0xffffff)) return memcpy(outbuf,"-",2),1; ++ if(wchan_is_number) return snprintf(outbuf, COLWID, "%x", (unsigned)(pp->wchan) & 0xffffffu); ++ w = lookup_wchan(pp->wchan, pp->XXXID); ++ len = strlen(w); ++ if(len>max_rightward) len=max_rightward; ++ memcpy(outbuf, w, len); ++ outbuf[len] = '\0'; ++ return len; ++} ++ ++static int pr_wname(char *restrict const outbuf, const proc_t *restrict const pp){ ++/* SGI's IRIX always uses a number for "wchan", so "wname" is provided too. ++ * ++ * We use '-' for running processes, the location when there is ++ * only one thread waiting in the kernel, and '*' when there is ++ * more than one thread waiting in the kernel. ++ * ++ * The output should be truncated to maximal columns width -- overflow ++ * is not supported for the "wchan". ++ */ ++ const char *w; ++ size_t len; ++ if(!(pp->wchan & 0xffffff)) return memcpy(outbuf,"-",2),1; ++ w = lookup_wchan(pp->wchan, pp->XXXID); ++ len = strlen(w); ++ if(len>max_rightward) len=max_rightward; ++ memcpy(outbuf, w, len); ++ outbuf[len] = '\0'; ++ return len; ++} ++ ++static int pr_nwchan(char *restrict const outbuf, const proc_t *restrict const pp){ ++ if(!(pp->wchan & 0xffffff)) return memcpy(outbuf,"-",2),1; ++ return snprintf(outbuf, COLWID, "%x", (unsigned)(pp->wchan) & 0xffffffu); ++} ++ ++/* Terrible trunctuation, like BSD crap uses: I999 J999 K999 */ ++/* FIXME: disambiguate /dev/tty69 and /dev/pts/69. */ ++static int pr_tty4(char *restrict const outbuf, const proc_t *restrict const pp){ ++/* snprintf(outbuf, COLWID, "%02x:%02x", pp->tty>>8, pp->tty&0xff); */ ++ return dev_to_tty(outbuf, 4, pp->tty, pp->XXXID, ABBREV_DEV|ABBREV_TTY|ABBREV_PTS); ++} ++ ++/* Unix98: format is unspecified, but must match that used by who(1). */ ++static int pr_tty8(char *restrict const outbuf, const proc_t *restrict const pp){ ++/* snprintf(outbuf, COLWID, "%02x:%02x", pp->tty>>8, pp->tty&0xff); */ ++ return dev_to_tty(outbuf, COLWID, pp->tty, pp->XXXID, ABBREV_DEV); ++} ++ ++#if 0 ++/* This BSD state display may contain spaces, which is illegal. */ ++static int pr_oldstate(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%s", status(pp)); ++} ++#endif ++ ++// This state display is Unix98 compliant and has lots of info like BSD. ++static int pr_stat(char *restrict const outbuf, const proc_t *restrict const pp){ ++ int end = 0; ++ outbuf[end++] = pp->state; ++// if(pp->rss==0 && pp->state!='Z') outbuf[end++] = 'W'; // useless "swapped out" ++ if(pp->nice < 0) outbuf[end++] = '<'; ++ if(pp->nice > 0) outbuf[end++] = 'N'; ++// In this order, NetBSD would add: ++// traced 'X' ++// systrace 'x' ++// exiting 'E' (not printed for zombies) ++// vforked 'V' ++// system 'K' (and do not print 'L' too) ++ if(pp->vm_lock) outbuf[end++] = 'L'; ++ if(pp->session == pp->tgid) outbuf[end++] = 's'; // session leader ++ if(pp->nlwp > 1) outbuf[end++] = 'l'; // multi-threaded ++ if(pp->pgrp == pp->tpgid) outbuf[end++] = '+'; // in foreground process group ++ outbuf[end] = '\0'; ++ return end; ++} ++ ++/* This minimal state display is Unix98 compliant, like SCO and SunOS 5 */ ++static int pr_s(char *restrict const outbuf, const proc_t *restrict const pp){ ++ outbuf[0] = pp->state; ++ outbuf[1] = '\0'; ++ return 1; ++} ++ ++static int pr_flag(char *restrict const outbuf, const proc_t *restrict const pp){ ++ /* Unix98 requires octal flags */ ++ /* this user-hostile and volatile junk gets 1 character */ ++ return snprintf(outbuf, COLWID, "%o", (unsigned)(pp->flags>>6U)&0x7U); ++} ++ ++// plus these: euid,ruid,egroup,rgroup (elsewhere in this file) ++ ++/*********** non-standard ***********/ ++ ++/*** BSD ++sess session pointer ++(SCO has:Process session leader ID as a decimal value. (SESSION)) ++jobc job control count ++cpu short-term cpu usage factor (for scheduling) ++sl sleep time (in seconds; 127 = infinity) ++re core residency time (in seconds; 127 = infinity) ++pagein pageins (same as majflt) ++lim soft memory limit ++tsiz text size (in Kbytes) ++***/ ++ ++static int pr_stackp(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%08x", (unsigned)(pp->start_stack)); ++} ++ ++static int pr_esp(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%08x", (unsigned)(pp->kstk_esp)); ++} ++ ++static int pr_eip(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%08x", (unsigned)(pp->kstk_eip)); ++} ++ ++/* This function helps print old-style time formats */ ++static int old_time_helper(char *dst, unsigned long long t, unsigned long long rel) { ++ if(!t) return snprintf(dst, COLWID, " -"); ++ if(t == ~0ULL) return snprintf(dst, COLWID, " xx"); ++ if((long long)(t-=rel) < 0) t=0ULL; ++ if(t>9999ULL) return snprintf(dst, COLWID, "%5Lu", t/100ULL); ++ else return snprintf(dst, COLWID, "%2u.%02u", (unsigned)t/100U, (unsigned)t%100U); ++} ++ ++static int pr_bsdtime(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long long t; ++ unsigned u; ++ t = pp->utime + pp->stime; ++ if(include_dead_children) t += (pp->cutime + pp->cstime); ++ u = t / Hertz; ++ return snprintf(outbuf, COLWID, "%3u:%02u", u/60U, u%60U); ++} ++ ++static int pr_bsdstart(char *restrict const outbuf, const proc_t *restrict const pp){ ++ time_t start; ++ time_t seconds_ago; ++ start = time_of_boot + pp->start_time / Hertz; ++ seconds_ago = seconds_since_1970 - start; ++ if(seconds_ago < 0) seconds_ago=0; ++ if(seconds_ago > 3600*24) strcpy(outbuf, ctime(&start)+4); ++ else strcpy(outbuf, ctime(&start)+10); ++ outbuf[6] = '\0'; ++ return 6; ++} ++ ++static int pr_alarm(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return old_time_helper(outbuf, pp->alarm, 0ULL); ++} ++ ++/* HP-UX puts this in pages and uses "vsz" for kB */ ++static int pr_sz(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%lu", (pp->vm_size)/(page_size/1024)); ++} ++ ++ ++/* ++ * FIXME: trs,drs,tsiz,dsiz,m_trs,m_drs,vm_exe,vm_data,trss ++ * I suspect some/all of those are broken. They seem to have been ++ * inherited by Linux and AIX from early BSD systems. FreeBSD only ++ * retains tsiz. The prefixed versions come from Debian. ++ * Sun and Digital have none of this crap. The code here comes ++ * from an old Linux ps, and might not be correct for ELF executables. ++ * ++ * AIX TRS size of resident-set (real memory) of text ++ * AIX TSIZ size of text (shared-program) image ++ * FreeBSD tsiz text size (in Kbytes) ++ * 4.3BSD NET/2 trss text resident set size (in Kbytes) ++ * 4.3BSD NET/2 tsiz text size (in Kbytes) ++ */ ++ ++/* kB data size. See drs, tsiz & trs. */ ++static int pr_dsiz(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long dsiz = 0; ++ if(pp->vsize) dsiz += (pp->vsize - pp->end_code + pp->start_code) >> 10; ++ return snprintf(outbuf, COLWID, "%ld", dsiz); ++} ++ ++/* kB text (code) size. See trs, dsiz & drs. */ ++static int pr_tsiz(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long tsiz = 0; ++ if(pp->vsize) tsiz += (pp->end_code - pp->start_code) >> 10; ++ return snprintf(outbuf, COLWID, "%ld", tsiz); ++} ++ ++/* kB _resident_ data size. See dsiz, tsiz & trs. */ ++static int pr_drs(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long drs = 0; ++ if(pp->vsize) drs += (pp->vsize - pp->end_code + pp->start_code) >> 10; ++ return snprintf(outbuf, COLWID, "%ld", drs); ++} ++ ++/* kB text _resident_ (code) size. See tsiz, dsiz & drs. */ ++static int pr_trs(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long trs = 0; ++ if(pp->vsize) trs += (pp->end_code - pp->start_code) >> 10; ++ return snprintf(outbuf, COLWID, "%ld", trs); ++} ++ ++/* approximation to: kB of address space that could end up in swap */ ++static int pr_swapable(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", pp->vm_data + pp->vm_stack); ++} ++ ++/* nasty old Debian thing */ ++static int pr_size(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%ld", pp->size); ++} ++ ++ ++static int pr_minflt(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long flt = pp->min_flt; ++ if(include_dead_children) flt += pp->cmin_flt; ++ return snprintf(outbuf, COLWID, "%ld", flt); ++} ++ ++static int pr_majflt(char *restrict const outbuf, const proc_t *restrict const pp){ ++ long flt = pp->maj_flt; ++ if(include_dead_children) flt += pp->cmaj_flt; ++ return snprintf(outbuf, COLWID, "%ld", flt); ++} ++ ++static int pr_lim(char *restrict const outbuf, const proc_t *restrict const pp){ ++ if(pp->rss_rlim == RLIM_INFINITY){ ++ outbuf[0] = 'x'; ++ outbuf[1] = 'x'; ++ outbuf[2] = '\0'; ++ return 2; ++ } ++ return snprintf(outbuf, COLWID, "%5ld", pp->rss_rlim >> 10); ++} ++ ++/* should print leading tilde ('~') if process is bound to the CPU */ ++static int pr_psr(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->processor); ++} ++ ++static int pr_rss(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%lu", pp->vm_rss); ++} ++ ++/* pp->vm_rss * 1000 would overflow on 32-bit systems with 64 GB memory */ ++static int pr_pmem(char *restrict const outbuf, const proc_t *restrict const pp){ ++ unsigned long pmem = 0; ++ pmem = pp->vm_rss * 1000ULL / kb_main_total; ++ if (pmem > 999) pmem = 999; ++ return snprintf(outbuf, COLWID, "%2u.%u", (unsigned)(pmem/10), (unsigned)(pmem%10)); ++} ++ ++static int pr_lstart(char *restrict const outbuf, const proc_t *restrict const pp){ ++ time_t t; ++ t = time_of_boot + pp->start_time / Hertz; ++ return snprintf(outbuf, COLWID, "%24.24s", ctime(&t)); ++} ++ ++/* Unix98 specifies a STIME header for a column that shows the start ++ * time of the process, but does not specify a format or format specifier. ++ * From the general Unix98 rules, we know there must not be any spaces. ++ * Most systems violate that rule, though the Solaris documentation ++ * claims to print the column without spaces. (NOT!) ++ * ++ * So this isn't broken, but could be renamed to u98_std_stime, ++ * as long as it still shows as STIME when using the -f option. ++ */ ++static int pr_stime(char *restrict const outbuf, const proc_t *restrict const pp){ ++ struct tm *proc_time; ++ struct tm *our_time; ++ time_t t; ++ const char *fmt; ++ int tm_year; ++ int tm_yday; ++ our_time = localtime(&seconds_since_1970); /* not reentrant */ ++ tm_year = our_time->tm_year; ++ tm_yday = our_time->tm_yday; ++ t = time_of_boot + pp->start_time / Hertz; ++ proc_time = localtime(&t); /* not reentrant, this corrupts our_time */ ++ fmt = "%H:%M"; /* 03:02 23:59 */ ++ if(tm_yday != proc_time->tm_yday) fmt = "%b%d"; /* Jun06 Aug27 */ ++ if(tm_year != proc_time->tm_year) fmt = "%Y"; /* 1991 2001 */ ++ return strftime(outbuf, 42, fmt, proc_time); ++} ++ ++static int pr_start(char *restrict const outbuf, const proc_t *restrict const pp){ ++ time_t t; ++ char *str; ++ t = time_of_boot + pp->start_time / Hertz; ++ str = ctime(&t); ++ if(str[8]==' ') str[8]='0'; ++ if(str[11]==' ') str[11]='0'; ++ if((unsigned long)t+60*60*24 > seconds_since_1970) ++ return snprintf(outbuf, COLWID, "%8.8s", str+11); ++ return snprintf(outbuf, COLWID, " %6.6s", str+4); ++} ++ ++ ++#ifdef SIGNAL_STRING ++static int help_pr_sig(char *restrict const outbuf, const char *restrict const sig){ ++ long len = 0; ++ len = strlen(sig); ++ if(wide_signals){ ++ if(len>8) return snprintf(outbuf, COLWID, "%s", sig); ++ return snprintf(outbuf, COLWID, "00000000%s", sig); ++ } ++ if(len-strspn(sig,"0") > 8) ++ return snprintf(outbuf, COLWID, "<%s", sig+len-8); ++ return snprintf(outbuf, COLWID, "%s", sig+len-8); ++} ++#else ++static int help_pr_sig(unsigned long long sig){ ++ if(wide_signals) return snprintf(outbuf, COLWID, "%016Lx", sig); ++ if(sig>>32) return snprintf(outbuf, COLWID, "<%08Lx", sig&0xffffffffLL); ++ return snprintf(outbuf, COLWID, "%08Lx", sig&0xffffffffLL); ++} ++#endif ++ ++static int pr_sig(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return help_pr_sig(outbuf, pp->signal); ++} ++static int pr_sigmask(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return help_pr_sig(outbuf, pp->blocked); ++} ++static int pr_sigignore(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return help_pr_sig(outbuf, pp->sigignore); ++} ++static int pr_sigcatch(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return help_pr_sig(outbuf, pp->sigcatch); ++} ++ ++ ++//////////////////////////////////////////////////////////////////////////////// ++ ++/* ++ * internal terms: ruid euid suid fuid ++ * kernel vars: uid euid suid fsuid ++ * command args: ruid uid svuid n/a ++ */ ++ ++static int pr_egid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->egid); ++} ++static int pr_rgid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->rgid); ++} ++static int pr_sgid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->sgid); ++} ++static int pr_fgid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->fgid); ++} ++ ++static int pr_euid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->euid); ++} ++static int pr_ruid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->ruid); ++} ++static int pr_suid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->suid); ++} ++static int pr_fuid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->fuid); ++} ++ ++// The Open Group Base Specifications Issue 6 (IEEE Std 1003.1, 2004 Edition) ++// requires that user and group names print as decimal numbers if there is ++// not enough room in the column, so tough luck if you don't like it. ++// ++// The UNIX and POSIX way to change column width is to rename it: ++// ps -o pid,user=CumbersomeUserNames -o comm ++// The easy way is to directly specify the desired width: ++// ps -o pid,user:19,comm ++// ++static int do_pr_name(char *restrict const outbuf, const char *restrict const name, unsigned u){ ++ if(!user_is_number){ ++ int rightward = OUTBUF_SIZE; /* max cells */ ++ int len; /* real cells */ ++ ++ escape_str(outbuf, name, OUTBUF_SIZE, &rightward); ++ len = OUTBUF_SIZE-rightward; ++ ++ if(len <= (int)max_rightward) ++ return len; /* returns number of cells */ ++ } ++ return snprintf(outbuf, COLWID, "%u", u); ++} ++ ++static int pr_ruser(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->ruser, pp->ruid); ++} ++static int pr_euser(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->euser, pp->euid); ++} ++static int pr_fuser(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->fuser, pp->fuid); ++} ++static int pr_suser(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->suser, pp->suid); ++} ++ ++static int pr_egroup(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->egroup, pp->egid); ++} ++static int pr_rgroup(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->rgroup, pp->rgid); ++} ++static int pr_fgroup(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->fgroup, pp->fgid); ++} ++static int pr_sgroup(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return do_pr_name(outbuf, pp->sgroup, pp->sgid); ++} ++ ++////////////////////////////////////////////////////////////////////////////////// ++ ++// TID tid LWP lwp SPID spid ++static int pr_thread(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%u", pp->tid); ++} ++// thcount THCNT ++static int pr_nlwp(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->nlwp); ++} ++ ++static int pr_sess(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%u", pp->session); ++} ++static int pr_tpgid(char *restrict const outbuf, const proc_t *restrict const pp){ ++ return snprintf(outbuf, COLWID, "%d", pp->tpgid); ++} ++ ++ ++/* SGI uses "cpu" to print the processor ID with header "P" */ ++static int pr_sgi_p(char *restrict const outbuf, const proc_t *restrict const pp){ /* FIXME */ ++ if(pp->state == 'R') return snprintf(outbuf, COLWID, "%d", pp->processor); ++ return snprintf(outbuf, COLWID, "*"); ++} ++ ++ ++/****************** FLASK & seLinux security stuff **********************/ ++// move the bulk of this to libproc sometime ++ ++static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){ ++ char filename[48]; ++ size_t len; ++ ssize_t num_read; ++ int fd; ++ ++// wchan file is suitable for testing ++//snprintf(filename, sizeof filename, "/proc/%d/wchan", pp->tgid); ++snprintf(filename, sizeof filename, "/proc/%d/attr/current", pp->tgid); ++ ++ fd = open(filename, O_RDONLY, 0); ++ if(likely(fd==-1)) goto fail; ++ num_read = read(fd, outbuf, 666); ++ close(fd); ++ if(unlikely(num_read<=0)) goto fail; ++ outbuf[num_read] = '\0'; ++ ++ len = 0; ++ while(outbuf[len]>' ' && outbuf[len]<='~') len++; ++ outbuf[len] = '\0'; ++ if(len) return len; ++ ++fail: ++ outbuf[0] = '-'; ++ outbuf[1] = '\0'; ++ return 1; ++} ++ ++#if 0 ++// This needs more study, considering: ++// 1. the static linking option (maybe disable this in that case) ++// 2. the -z and -Z option issue ++// 3. width of output ++static int pr_context(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static int (*ps_getpidcon)(pid_t pid, char **context) = 0; ++ static int tried_load = 0; ++ size_t len; ++ char *context; ++ ++ if(!ps_getpidcon && !tried_load){ ++ void *handle = dlopen("libselinux.so.1", RTLD_NOW); ++ if(handle){ ++ dlerror(); ++ ps_getpidcon = dlsym(handle, "getpidcon"); ++ if(dlerror()) ++ ps_getpidcon = 0; ++ } ++ tried_load++; ++ } ++ if(ps_getpidcon && !ps_getpidcon(pp->tgid, &context)){ ++ size_t max_len = OUTBUF_SIZE-1; ++ len = strlen(context); ++ if(len > max_len) len = max_len; ++ memcpy(outbuf, context, len); ++ outbuf[len] = '\0'; ++ free(context); ++ }else{ ++ outbuf[0] = '-'; ++ outbuf[1] = '\0'; ++ len = 1; ++ } ++ return len; ++} ++#endif ++ ++ ++////////////////////////////// Test code ///////////////////////////////// ++ ++// like "args" ++static int pr_t_unlimited(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"[123456789-12345] ","ps","123456789-123456"}; ++ (void)pp; ++ snprintf(outbuf, max_rightward+1, "%s", vals[lines_to_next_header%3u]); ++ return strlen(outbuf); ++} ++static int pr_t_unlimited2(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"unlimited", "[123456789-12345] ","ps","123456789-123456"}; ++ (void)pp; ++ snprintf(outbuf, max_rightward+1, "%s", vals[lines_to_next_header%4u]); ++ return strlen(outbuf); ++} ++ ++// like "etime" ++static int pr_t_right(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"999-23:59:59","99-23:59:59","9-23:59:59","59:59"}; ++ (void)pp; ++ return snprintf(outbuf, COLWID, "%s", vals[lines_to_next_header%4u]); ++} ++static int pr_t_right2(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"999-23:59:59","99-23:59:59","9-23:59:59"}; ++ (void)pp; ++ return snprintf(outbuf, COLWID, "%s", vals[lines_to_next_header%3u]); ++} ++ ++// like "tty" ++static int pr_t_left(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"tty7","pts/9999","iseries/vtty42","ttySMX0","3270/tty4"}; ++ (void)pp; ++ return snprintf(outbuf, COLWID, "%s", vals[lines_to_next_header%5u]); ++} ++static int pr_t_left2(char *restrict const outbuf, const proc_t *restrict const pp){ ++ static const char *const vals[] = {"tty7","pts/9999","ttySMX0","3270/tty4"}; ++ (void)pp; ++ return snprintf(outbuf, COLWID, "%s", vals[lines_to_next_header%4u]); ++} ++ ++/***************************************************************************/ ++/*************************** other stuff ***********************************/ ++ ++/* ++ * Old header specifications. ++ * ++ * short Up " PID TTY STAT TIME COMMAND" ++ * long l Pp " FLAGS UID PID PPID PRI NI SIZE RSS WCHAN STA TTY TIME COMMAND ++ * user u up "USER PID %CPU %MEM SIZE RSS TTY STAT START TIME COMMAND ++ * jobs j gPp " PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND ++ * sig s p " UID PID SIGNAL BLOCKED IGNORED CATCHED STAT TTY TIME COMMAND ++ * vm v r " PID TTY STAT TIME PAGEIN TSIZ DSIZ RSS LIM %MEM COMMAND ++ * m m r " PID TTY MAJFLT MINFLT TRS DRS SIZE SWAP RSS SHRD LIB DT COMMAND ++ * regs X p "NR PID STACK ESP EIP TMOUT ALARM STAT TTY TIME COMMAND ++ */ ++ ++/* ++ * Unix98 requires that the heading for tty is TT, though XPG4, Digital, ++ * and BSD use TTY. The Unix98 headers are: ++ * args,comm,etime,group,nice,pcpu,pgid ++ * pid,ppid,rgroup,ruser,time,tty,user,vsz ++ * ++ * BSD c: "command" becomes accounting name ("comm" or "ucomm") ++ * BSD n: "user" becomes "uid" and "wchan" becomes "nwchan" (number) ++ */ ++ ++/* Justification control for flags field. */ ++#define USER CF_USER // left if text, right if numeric ++#define LEFT CF_LEFT ++#define RIGHT CF_RIGHT ++#define UNLIMITED CF_UNLIMITED ++#define WCHAN CF_WCHAN // left if text, right if numeric ++#define SIGNAL CF_SIGNAL // right in 9, or 16 if room ++#define PIDMAX CF_PIDMAX ++#define TO CF_PRINT_THREAD_ONLY ++#define PO CF_PRINT_PROCESS_ONLY ++#define ET CF_PRINT_EVERY_TIME ++#define AN CF_PRINT_AS_NEEDED // no idea ++ ++/* short names to save space */ ++#define MEM PROC_FILLMEM /* read statm */ ++#define ARG PROC_FILLARG /* read cmdline (cleared if c option) */ ++#define COM PROC_FILLCOM /* read cmdline (cleared if not -f option) */ ++#define ENV PROC_FILLENV /* read environ */ ++#define USR PROC_FILLUSR /* uid_t -> user names */ ++#define GRP PROC_FILLGRP /* gid_t -> group names */ ++#define WCH PROC_FILLWCHAN /* do WCHAN lookup */ ++ ++ ++/* TODO ++ * pull out annoying BSD aliases into another table (to macro table?) ++ * add sorting functions here (to unify names) ++ */ ++ ++/* temporary hack -- mark new stuff grabbed from Debian ps */ ++#define LNx LNX ++ ++/* there are about 211 listed */ ++ ++/* Many of these are placeholders for unsupported options. */ ++static const format_struct format_array[] = { ++/* code header print() sort() width need vendor flags */ ++{"%cpu", "%CPU", pr_pcpu, sr_pcpu, 4, 0, BSD, ET|RIGHT}, /*pcpu*/ ++{"%mem", "%MEM", pr_pmem, sr_nop, 4, 0, BSD, PO|RIGHT}, /*pmem*/ ++{"_left", "LLLLLLLL", pr_t_left, sr_nop, 8, 0, TST, ET|LEFT}, ++{"_left2", "L2L2L2L2", pr_t_left2, sr_nop, 8, 0, TST, ET|LEFT}, ++{"_right", "RRRRRRRRRRR", pr_t_right, sr_nop, 11, 0, TST, ET|RIGHT}, ++{"_right2", "R2R2R2R2R2R", pr_t_right2, sr_nop, 11, 0, TST, ET|RIGHT}, ++{"_unlimited","U", pr_t_unlimited, sr_nop, 16, 0, TST, ET|UNLIMITED}, ++{"_unlimited2","U2", pr_t_unlimited2, sr_nop, 16, 0, TST, ET|UNLIMITED}, ++{"acflag", "ACFLG", pr_nop, sr_nop, 5, 0, XXX, AN|RIGHT}, /*acflg*/ ++{"acflg", "ACFLG", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, /*acflag*/ ++{"addr", "ADDR", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT}, ++{"addr_1", "ADDR", pr_nop, sr_nop, 1, 0, LNX, AN|LEFT}, ++{"alarm", "ALARM", pr_alarm, sr_alarm, 5, 0, LNX, AN|RIGHT}, ++{"argc", "ARGC", pr_nop, sr_nop, 4, 0, LNX, PO|RIGHT}, ++{"args", "COMMAND", pr_args, sr_cmd, 27, ARG, U98, PO|UNLIMITED}, /*command*/ ++{"atime", "TIME", pr_time, sr_nop, 8, 0, SOE, ET|RIGHT}, /*cputime*/ /* was 6 wide */ ++{"blocked", "BLOCKED", pr_sigmask, sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigmask*/ ++{"bnd", "BND", pr_nop, sr_nop, 1, 0, AIX, TO|RIGHT}, ++{"bsdstart", "START", pr_bsdstart, sr_nop, 6, 0, LNX, ET|RIGHT}, ++{"bsdtime", "TIME", pr_bsdtime, sr_nop, 6, 0, LNX, ET|RIGHT}, ++{"c", "C", pr_c, sr_pcpu, 2, 0, SUN, ET|RIGHT}, ++{"caught", "CAUGHT", pr_sigcatch, sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigcatch*/ ++{"class", "CLS", pr_class, sr_sched, 3, 0, XXX, TO|LEFT}, ++{"cls", "CLS", pr_class, sr_sched, 3, 0, HPU, TO|RIGHT}, /*says HPUX or RT*/ ++{"cmaj_flt", "-", pr_nop, sr_cmaj_flt, 1, 0, LNX, AN|RIGHT}, ++{"cmd", "CMD", pr_args, sr_cmd, 27, ARG, DEC, PO|UNLIMITED}, /*ucomm*/ ++{"cmin_flt", "-", pr_nop, sr_cmin_flt, 1, 0, LNX, AN|RIGHT}, ++{"cnswap", "-", pr_nop, sr_nop, 1, 0, LNX, AN|RIGHT}, ++{"comm", "COMMAND", pr_comm, sr_cmd, 15, COM, U98, PO|UNLIMITED}, /*ucomm*/ ++{"command", "COMMAND", pr_args, sr_cmd, 27, ARG, XXX, PO|UNLIMITED}, /*args*/ ++{"context", "CONTEXT", pr_context, sr_nop, 31, 0, LNX, ET|LEFT}, ++{"cp", "CP", pr_cp, sr_pcpu, 3, 0, DEC, ET|RIGHT}, /*cpu*/ ++{"cpu", "CPU", pr_nop, sr_nop, 3, 0, BSD, AN|RIGHT}, /* FIXME ... HP-UX wants this as the CPU number for SMP? */ ++{"cpuid", "CPUID", pr_psr, sr_nop, 5, 0, BSD, TO|RIGHT}, // OpenBSD: 8 wide! ++{"cputime", "TIME", pr_time, sr_nop, 8, 0, DEC, ET|RIGHT}, /*time*/ ++{"cstime", "-", pr_nop, sr_cstime, 1, 0, LNX, AN|RIGHT}, ++{"ctid", "CTID", pr_nop, sr_nop, 5, 0, SUN, ET|RIGHT}, // resource contracts? ++{"cursig", "CURSIG", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT}, ++{"cutime", "-", pr_nop, sr_cutime, 1, 0, LNX, AN|RIGHT}, ++{"cwd", "CWD", pr_nop, sr_nop, 3, 0, LNX, AN|LEFT}, ++{"drs", "DRS", pr_drs, sr_drs, 5, MEM, LNX, PO|RIGHT}, ++{"dsiz", "DSIZ", pr_dsiz, sr_nop, 4, 0, LNX, PO|RIGHT}, ++{"egid", "EGID", pr_egid, sr_egid, 5, 0, LNX, ET|RIGHT}, ++{"egroup", "EGROUP", pr_egroup, sr_egroup, 8, GRP, LNX, ET|USER}, ++{"eip", "EIP", pr_eip, sr_kstk_eip, 8, 0, LNX, TO|RIGHT}, ++{"emul", "EMUL", pr_nop, sr_nop, 13, 0, BSD, PO|LEFT}, /* "FreeBSD ELF32" and such */ ++{"end_code", "E_CODE", pr_nop, sr_end_code, 8, 0, LNx, PO|RIGHT}, ++{"environ","ENVIRONMENT",pr_nop, sr_nop, 11, ENV, LNx, PO|UNLIMITED}, ++{"esp", "ESP", pr_esp, sr_kstk_esp, 8, 0, LNX, TO|RIGHT}, ++{"etime", "ELAPSED", pr_etime, sr_nop, 11, 0, U98, ET|RIGHT}, /* was 7 wide */ ++{"euid", "EUID", pr_euid, sr_euid, 5, 0, LNX, ET|RIGHT}, ++{"euser", "EUSER", pr_euser, sr_euser, 8, USR, LNX, ET|USER}, ++{"f", "F", pr_flag, sr_flags, 1, 0, XXX, ET|RIGHT}, /*flags*/ ++{"fgid", "FGID", pr_fgid, sr_fgid, 5, 0, LNX, ET|RIGHT}, ++{"fgroup", "FGROUP", pr_fgroup, sr_fgroup, 8, GRP, LNX, ET|USER}, ++{"flag", "F", pr_flag, sr_flags, 1, 0, DEC, ET|RIGHT}, ++{"flags", "F", pr_flag, sr_flags, 1, 0, BSD, ET|RIGHT}, /*f*/ /* was FLAGS, 8 wide */ ++{"fname", "COMMAND", pr_fname, sr_nop, 8, 0, SUN, PO|LEFT}, ++{"fsgid", "FSGID", pr_fgid, sr_fgid, 5, 0, LNX, ET|RIGHT}, ++{"fsgroup", "FSGROUP", pr_fgroup, sr_fgroup, 8, GRP, LNX, ET|USER}, ++{"fsuid", "FSUID", pr_fuid, sr_fuid, 5, 0, LNX, ET|RIGHT}, ++{"fsuser", "FSUSER", pr_fuser, sr_fuser, 8, USR, LNX, ET|USER}, ++{"fuid", "FUID", pr_fuid, sr_fuid, 5, 0, LNX, ET|RIGHT}, ++{"fuser", "FUSER", pr_fuser, sr_fuser, 8, USR, LNX, ET|USER}, ++{"gid", "GID", pr_egid, sr_egid, 5, 0, SUN, ET|RIGHT}, ++{"group", "GROUP", pr_egroup, sr_egroup, 8, GRP, U98, ET|USER}, ++{"iac", "IAC", pr_nop, sr_nop, 4, 0, BSD, AN|RIGHT}, // DragonFly ++{"ignored", "IGNORED", pr_sigignore,sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigignore*/ ++{"inblk", "INBLK", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, /*inblock*/ ++{"inblock", "INBLK", pr_nop, sr_nop, 5, 0, DEC, AN|RIGHT}, /*inblk*/ ++{"intpri", "PRI", pr_opri, sr_priority, 3, 0, HPU, TO|RIGHT}, ++{"jid", "JID", pr_nop, sr_nop, 1, 0, SGI, PO|RIGHT}, ++{"jobc", "JOBC", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT}, ++{"ktrace", "KTRACE", pr_nop, sr_nop, 8, 0, BSD, AN|RIGHT}, ++{"ktracep", "KTRACEP", pr_nop, sr_nop, 8, 0, BSD, AN|RIGHT}, ++{"label", "LABEL", pr_context, sr_nop, 31, 0, SGI, ET|LEFT}, ++{"lastcpu", "C", pr_psr, sr_nop, 3, 0, BSD, TO|RIGHT}, // DragonFly ++{"lim", "LIM", pr_lim, sr_rss_rlim, 5, 0, BSD, AN|RIGHT}, ++{"login", "LOGNAME", pr_nop, sr_nop, 8, 0, BSD, AN|LEFT}, /*logname*/ /* double check */ ++{"logname", "LOGNAME", pr_nop, sr_nop, 8, 0, XXX, AN|LEFT}, /*login*/ ++{"longtname", "TTY", pr_tty8, sr_tty, 8, 0, DEC, PO|LEFT}, ++{"lstart", "STARTED", pr_lstart, sr_nop, 24, 0, XXX, ET|RIGHT}, ++{"luid", "LUID", pr_nop, sr_nop, 5, 0, LNX, ET|RIGHT}, /* login ID */ ++{"luser", "LUSER", pr_nop, sr_nop, 8, USR, LNX, ET|USER}, /* login USER */ ++{"lwp", "LWP", pr_thread, sr_tid, 5, 0, SUN, TO|PIDMAX|RIGHT}, ++{"m_drs", "DRS", pr_drs, sr_drs, 5, MEM, LNx, PO|RIGHT}, ++{"m_dt", "DT", pr_nop, sr_dt, 4, MEM, LNx, PO|RIGHT}, ++{"m_lrs", "LRS", pr_nop, sr_lrs, 5, MEM, LNx, PO|RIGHT}, ++{"m_resident", "RES", pr_nop, sr_resident, 5,MEM, LNx, PO|RIGHT}, ++{"m_share", "SHRD", pr_nop, sr_share, 5, MEM, LNx, PO|RIGHT}, ++{"m_size", "SIZE", pr_size, sr_size, 5, MEM, LNX, PO|RIGHT}, ++{"m_swap", "SWAP", pr_nop, sr_nop, 5, 0, LNx, PO|RIGHT}, ++{"m_trs", "TRS", pr_trs, sr_trs, 5, MEM, LNx, PO|RIGHT}, ++{"maj_flt", "MAJFL", pr_majflt, sr_maj_flt, 6, 0, LNX, AN|RIGHT}, ++{"majflt", "MAJFLT", pr_majflt, sr_maj_flt, 6, 0, XXX, AN|RIGHT}, ++{"min_flt", "MINFL", pr_minflt, sr_min_flt, 6, 0, LNX, AN|RIGHT}, ++{"minflt", "MINFLT", pr_minflt, sr_min_flt, 6, 0, XXX, AN|RIGHT}, ++{"msgrcv", "MSGRCV", pr_nop, sr_nop, 6, 0, XXX, AN|RIGHT}, ++{"msgsnd", "MSGSND", pr_nop, sr_nop, 6, 0, XXX, AN|RIGHT}, ++{"mwchan", "MWCHAN", pr_nop, sr_nop, 6, WCH, BSD, TO|WCHAN}, /* mutex (FreeBSD) */ ++{"ni", "NI", pr_nice, sr_nice, 3, 0, BSD, TO|RIGHT}, /*nice*/ ++{"nice", "NI", pr_nice, sr_nice, 3, 0, U98, TO|RIGHT}, /*ni*/ ++{"nivcsw", "IVCSW", pr_nop, sr_nop, 5, 0, XXX, AN|RIGHT}, ++{"nlwp", "NLWP", pr_nlwp, sr_nlwp, 4, 0, SUN, PO|RIGHT}, ++{"nsignals", "NSIGS", pr_nop, sr_nop, 5, 0, DEC, AN|RIGHT}, /*nsigs*/ ++{"nsigs", "NSIGS", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, /*nsignals*/ ++{"nswap", "NSWAP", pr_nop, sr_nop, 5, 0, XXX, AN|RIGHT}, ++{"nvcsw", "VCSW", pr_nop, sr_nop, 5, 0, XXX, AN|RIGHT}, ++{"nwchan", "WCHAN", pr_nwchan, sr_nop, 6, 0, XXX, TO|RIGHT}, ++{"opri", "PRI", pr_opri, sr_priority, 3, 0, SUN, TO|RIGHT}, ++{"osz", "SZ", pr_nop, sr_nop, 2, 0, SUN, PO|RIGHT}, ++{"oublk", "OUBLK", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, /*oublock*/ ++{"oublock", "OUBLK", pr_nop, sr_nop, 5, 0, DEC, AN|RIGHT}, /*oublk*/ ++{"p_ru", "P_RU", pr_nop, sr_nop, 6, 0, BSD, AN|RIGHT}, ++{"paddr", "PADDR", pr_nop, sr_nop, 6, 0, BSD, AN|RIGHT}, ++{"pagein", "PAGEIN", pr_majflt, sr_maj_flt, 6, 0, XXX, AN|RIGHT}, ++{"pcpu", "%CPU", pr_pcpu, sr_pcpu, 4, 0, U98, ET|RIGHT}, /*%cpu*/ ++{"pending", "PENDING", pr_sig, sr_nop, 9, 0, BSD, ET|SIGNAL}, /*sig*/ ++{"pgid", "PGID", pr_pgid, sr_pgrp, 5, 0, U98, PO|PIDMAX|RIGHT}, ++{"pgrp", "PGRP", pr_pgid, sr_pgrp, 5, 0, LNX, PO|PIDMAX|RIGHT}, ++{"pid", "PID", pr_pid, sr_tgid, 5, 0, U98, PO|PIDMAX|RIGHT}, ++{"pmem", "%MEM", pr_pmem, sr_nop, 4, 0, XXX, PO|RIGHT}, /*%mem*/ ++{"poip", "-", pr_nop, sr_nop, 1, 0, BSD, AN|RIGHT}, ++{"policy", "POL", pr_class, sr_sched, 3, 0, DEC, TO|LEFT}, ++{"ppid", "PPID", pr_ppid, sr_ppid, 5, 0, U98, PO|PIDMAX|RIGHT}, ++{"pri", "PRI", pr_pri, sr_nop, 3, 0, XXX, TO|RIGHT}, ++{"pri_api", "API", pr_pri_api, sr_nop, 3, 0, LNX, TO|RIGHT}, ++{"pri_bar", "BAR", pr_pri_bar, sr_nop, 3, 0, LNX, TO|RIGHT}, ++{"pri_baz", "BAZ", pr_pri_baz, sr_nop, 3, 0, LNX, TO|RIGHT}, ++{"pri_foo", "FOO", pr_pri_foo, sr_nop, 3, 0, LNX, TO|RIGHT}, ++{"priority", "PRI", pr_priority, sr_priority, 3, 0, LNX, TO|RIGHT}, ++{"prmgrp", "PRMGRP", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT}, ++{"prmid", "PRMID", pr_nop, sr_nop, 12, 0, HPU, PO|RIGHT}, ++{"project", "PROJECT", pr_nop, sr_nop, 12, 0, SUN, PO|LEFT}, // see prm* andctid ++{"projid", "PROJID", pr_nop, sr_nop, 5, 0, SUN, PO|RIGHT}, ++{"pset", "PSET", pr_nop, sr_nop, 4, 0, DEC, TO|RIGHT}, ++{"psr", "PSR", pr_psr, sr_nop, 3, 0, DEC, TO|RIGHT}, ++{"psxpri", "PPR", pr_nop, sr_nop, 3, 0, DEC, TO|RIGHT}, ++{"re", "RE", pr_nop, sr_nop, 3, 0, BSD, AN|RIGHT}, ++{"resident", "RES", pr_nop, sr_resident, 5,MEM, LNX, PO|RIGHT}, ++{"rgid", "RGID", pr_rgid, sr_rgid, 5, 0, XXX, ET|RIGHT}, ++{"rgroup", "RGROUP", pr_rgroup, sr_rgroup, 8, GRP, U98, ET|USER}, /* was 8 wide */ ++{"rlink", "RLINK", pr_nop, sr_nop, 8, 0, BSD, AN|RIGHT}, ++{"rss", "RSS", pr_rss, sr_rss, 5, 0, XXX, PO|RIGHT}, /* was 5 wide */ ++{"rssize", "RSS", pr_rss, sr_vm_rss, 5, 0, DEC, PO|RIGHT}, /*rsz*/ ++{"rsz", "RSZ", pr_rss, sr_vm_rss, 5, 0, BSD, PO|RIGHT}, /*rssize*/ ++{"rtprio", "RTPRIO", pr_rtprio, sr_rtprio, 6, 0, BSD, TO|RIGHT}, ++{"ruid", "RUID", pr_ruid, sr_ruid, 5, 0, XXX, ET|RIGHT}, ++{"ruser", "RUSER", pr_ruser, sr_ruser, 8, USR, U98, ET|USER}, ++{"s", "S", pr_s, sr_state, 1, 0, SUN, TO|LEFT}, /*stat,state*/ ++{"sched", "SCH", pr_sched, sr_sched, 3, 0, AIX, TO|RIGHT}, ++{"scnt", "SCNT", pr_nop, sr_nop, 4, 0, DEC, AN|RIGHT}, /* man page misspelling of scount? */ ++{"scount", "SC", pr_nop, sr_nop, 4, 0, AIX, AN|RIGHT}, /* scnt==scount, DEC claims both */ ++{"sess", "SESS", pr_sess, sr_session, 5, 0, XXX, PO|PIDMAX|RIGHT}, ++{"session", "SESS", pr_sess, sr_session, 5, 0, LNX, PO|PIDMAX|RIGHT}, ++{"sgi_p", "P", pr_sgi_p, sr_nop, 1, 0, LNX, TO|RIGHT}, /* "cpu" number */ ++{"sgi_rss", "RSS", pr_rss, sr_nop, 4, 0, LNX, PO|LEFT}, /* SZ:RSS */ ++{"sgid", "SGID", pr_sgid, sr_sgid, 5, 0, LNX, ET|RIGHT}, ++{"sgroup", "SGROUP", pr_sgroup, sr_sgroup, 8, GRP, LNX, ET|USER}, ++{"share", "-", pr_nop, sr_share, 1, MEM, LNX, PO|RIGHT}, ++{"sid", "SID", pr_sess, sr_session, 5, 0, XXX, PO|PIDMAX|RIGHT}, /* Sun & HP */ ++{"sig", "PENDING", pr_sig, sr_nop, 9, 0, XXX, ET|SIGNAL}, /*pending*/ ++{"sig_block", "BLOCKED", pr_sigmask, sr_nop, 9, 0, LNX, TO|SIGNAL}, ++{"sig_catch", "CATCHED", pr_sigcatch, sr_nop, 9, 0, LNX, TO|SIGNAL}, ++{"sig_ignore", "IGNORED",pr_sigignore, sr_nop, 9, 0, LNX, TO|SIGNAL}, ++{"sig_pend", "SIGNAL", pr_sig, sr_nop, 9, 0, LNX, ET|SIGNAL}, ++{"sigcatch", "CAUGHT", pr_sigcatch, sr_nop, 9, 0, XXX, TO|SIGNAL}, /*caught*/ ++{"sigignore", "IGNORED", pr_sigignore,sr_nop, 9, 0, XXX, TO|SIGNAL}, /*ignored*/ ++{"sigmask", "BLOCKED", pr_sigmask, sr_nop, 9, 0, XXX, TO|SIGNAL}, /*blocked*/ ++{"size", "SZ", pr_swapable, sr_swapable, 5, 0, SCO, PO|RIGHT}, ++{"sl", "SL", pr_nop, sr_nop, 3, 0, XXX, AN|RIGHT}, ++{"spid", "SPID", pr_thread, sr_tid, 5, 0, SGI, TO|PIDMAX|RIGHT}, ++{"stackp", "STACKP", pr_stackp, sr_start_stack, 8, 0, LNX, PO|RIGHT}, /*start_stack*/ ++{"start", "STARTED", pr_start, sr_nop, 8, 0, XXX, ET|RIGHT}, ++{"start_code", "S_CODE", pr_nop, sr_start_code, 8, 0, LNx, PO|RIGHT}, ++{"start_stack", "STACKP", pr_stackp, sr_start_stack, 8, 0, LNX, PO|RIGHT}, /*stackp*/ ++{"start_time", "START", pr_stime, sr_start_time, 5, 0, LNx, ET|RIGHT}, ++{"stat", "STAT", pr_stat, sr_state, 4, 0, BSD, TO|LEFT}, /*state,s*/ ++{"state", "S", pr_s, sr_state, 1, 0, XXX, TO|LEFT}, /*stat,s*/ /* was STAT */ ++{"status", "STATUS", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT}, ++{"stime", "STIME", pr_stime, sr_stime, 5, 0, XXX, ET|RIGHT}, /* was 6 wide */ ++{"suid", "SUID", pr_suid, sr_suid, 5, 0, LNx, ET|RIGHT}, ++{"suser", "SUSER", pr_suser, sr_suser, 8, USR, LNx, ET|USER}, ++{"svgid", "SVGID", pr_sgid, sr_sgid, 5, 0, XXX, ET|RIGHT}, ++{"svgroup", "SVGROUP", pr_sgroup, sr_sgroup, 8, GRP, LNX, ET|USER}, ++{"svuid", "SVUID", pr_suid, sr_suid, 5, 0, XXX, ET|RIGHT}, ++{"svuser", "SVUSER", pr_suser, sr_suser, 8, USR, LNX, ET|USER}, ++{"systime", "SYSTEM", pr_nop, sr_nop, 6, 0, DEC, ET|RIGHT}, ++{"sz", "SZ", pr_sz, sr_nop, 5, 0, HPU, PO|RIGHT}, ++{"taskid", "TASKID", pr_nop, sr_nop, 5, 0, SUN, TO|PIDMAX|RIGHT}, // is this a thread ID? ++{"tdev", "TDEV", pr_nop, sr_nop, 4, 0, XXX, AN|RIGHT}, ++{"thcount", "THCNT", pr_nlwp, sr_nlwp, 5, 0, AIX, PO|RIGHT}, ++{"tid", "TID", pr_thread, sr_tid, 5, 0, AIX, TO|PIDMAX|RIGHT}, ++{"time", "TIME", pr_time, sr_nop, 8, 0, U98, ET|RIGHT}, /*cputime*/ /* was 6 wide */ ++{"timeout", "TMOUT", pr_nop, sr_nop, 5, 0, LNX, AN|RIGHT}, // 2.0.xx era ++{"tmout", "TMOUT", pr_nop, sr_nop, 5, 0, LNX, AN|RIGHT}, // 2.0.xx era ++{"tname", "TTY", pr_tty8, sr_tty, 8, 0, DEC, PO|LEFT}, ++{"tpgid", "TPGID", pr_tpgid, sr_tpgid, 5, 0, XXX, PO|PIDMAX|RIGHT}, ++{"trs", "TRS", pr_trs, sr_trs, 4, MEM, AIX, PO|RIGHT}, ++{"trss", "TRSS", pr_trs, sr_trs, 4, MEM, BSD, PO|RIGHT}, /* 4.3BSD NET/2 */ ++{"tsess", "TSESS", pr_nop, sr_nop, 5, 0, BSD, PO|PIDMAX|RIGHT}, ++{"tsession", "TSESS", pr_nop, sr_nop, 5, 0, DEC, PO|PIDMAX|RIGHT}, ++{"tsid", "TSID", pr_nop, sr_nop, 5, 0, BSD, PO|PIDMAX|RIGHT}, ++{"tsiz", "TSIZ", pr_tsiz, sr_nop, 4, 0, BSD, PO|RIGHT}, ++{"tt", "TT", pr_tty8, sr_tty, 8, 0, BSD, PO|LEFT}, ++{"tty", "TT", pr_tty8, sr_tty, 8, 0, U98, PO|LEFT}, /* Unix98 requires "TT" but has "TTY" too. :-( */ /* was 3 wide */ ++{"tty4", "TTY", pr_tty4, sr_tty, 4, 0, LNX, PO|LEFT}, ++{"tty8", "TTY", pr_tty8, sr_tty, 8, 0, LNX, PO|LEFT}, ++{"u_procp", "UPROCP", pr_nop, sr_nop, 6, 0, DEC, AN|RIGHT}, ++{"ucmd", "CMD", pr_comm, sr_cmd, 15, COM, DEC, PO|UNLIMITED}, /*ucomm*/ ++{"ucomm", "COMMAND", pr_comm, sr_cmd, 15, COM, XXX, PO|UNLIMITED}, /*comm*/ ++{"uid", "UID", pr_euid, sr_euid, 5, 0, XXX, ET|RIGHT}, ++{"uid_hack", "UID", pr_euser, sr_euser, 8, USR, XXX, ET|USER}, ++{"umask", "UMASK", pr_nop, sr_nop, 5, 0, DEC, AN|RIGHT}, ++{"uname", "USER", pr_euser, sr_euser, 8, USR, DEC, ET|USER}, /* man page misspelling of user? */ ++{"upr", "UPR", pr_nop, sr_nop, 3, 0, BSD, TO|RIGHT}, /*usrpri*/ ++{"uprocp", "UPROCP", pr_nop, sr_nop, 8, 0, BSD, AN|RIGHT}, ++{"user", "USER", pr_euser, sr_euser, 8, USR, U98, ET|USER}, /* BSD n forces this to UID */ ++{"usertime", "USER", pr_nop, sr_nop, 4, 0, DEC, ET|RIGHT}, ++{"usrpri", "UPR", pr_nop, sr_nop, 3, 0, DEC, TO|RIGHT}, /*upr*/ ++{"util", "C", pr_c, sr_pcpu, 2, 0, SGI, ET|RIGHT}, // not sure about "C" ++{"utime", "UTIME", pr_nop, sr_utime, 6, 0, LNx, ET|RIGHT}, ++{"vm_data", "DATA", pr_nop, sr_vm_data, 5, 0, LNx, PO|RIGHT}, ++{"vm_exe", "EXE", pr_nop, sr_vm_exe, 5, 0, LNx, PO|RIGHT}, ++{"vm_lib", "LIB", pr_nop, sr_vm_lib, 5, 0, LNx, PO|RIGHT}, ++{"vm_lock", "LCK", pr_nop, sr_vm_lock, 3, 0, LNx, PO|RIGHT}, ++{"vm_stack", "STACK", pr_nop, sr_vm_stack, 5, 0, LNx, PO|RIGHT}, ++{"vsize", "VSZ", pr_vsz, sr_vsize, 6, 0, DEC, PO|RIGHT}, /*vsz*/ ++{"vsz", "VSZ", pr_vsz, sr_vm_size, 6, 0, U98, PO|RIGHT}, /*vsize*/ ++{"wchan", "WCHAN", pr_wchan, sr_wchan, 6, WCH, XXX, TO|WCHAN}, /* BSD n forces this to nwchan */ /* was 10 wide */ ++{"wname", "WCHAN", pr_wname, sr_nop, 6, WCH, SGI, TO|WCHAN}, /* opposite of nwchan */ ++{"xstat", "XSTAT", pr_nop, sr_nop, 5, 0, BSD, AN|RIGHT}, ++{"zone", "ZONE", pr_context, sr_nop, 31, 0, SUN, ET|LEFT}, // Solaris zone == Linux context? ++{"zoneid", "ZONEID", pr_nop, sr_nop, 31, 0, SUN, ET|RIGHT},// Linux only offers context names ++{"~", "-", pr_nop, sr_nop, 1, 0, LNX, AN|RIGHT} /* NULL would ruin alphabetical order */ ++}; ++ ++#undef USER ++#undef LEFT ++#undef RIGHT ++#undef UNLIMITED ++#undef WCHAN ++#undef SIGNAL ++#undef PIDMAX ++#undef PO ++#undef TO ++#undef AN ++#undef ET ++ ++static const int format_array_count = sizeof(format_array)/sizeof(format_struct); ++ ++ ++/****************************** Macro formats *******************************/ ++/* First X field may be NR, which is p->start_code>>26 printed with %2ld */ ++/* That seems useless though, and Debian already killed it. */ ++/* The ones marked "Digital" have the name defined, not just the data. */ ++static const macro_struct macro_array[] = { ++{"DFMT", "pid,tname,state,cputime,cmd"}, /* Digital's default */ ++{"DefBSD", "pid,tname,stat,bsdtime,args"}, /* Our BSD default */ ++{"DefSysV", "pid,tname,time,cmd"}, /* Our SysV default */ ++{"END_BSD", "state,tname,cputime,comm"}, /* trailer for O */ ++{"END_SYS5", "state,tname,time,command"}, /* trailer for -O */ ++{"F5FMT", "uname,pid,ppid,c,start,tname,time,cmd"}, /* Digital -f */ ++ ++{"FB_", "pid,tt,stat,time,command"}, /* FreeBSD default */ ++{"FB_j", "user,pid,ppid,pgid,sess,jobc,stat,tt,time,command"}, /* FreeBSD j */ ++{"FB_l", "uid,pid,ppid,cpu,pri,nice,vsz,rss,wchan,stat,tt,time,command"}, /* FreeBSD l */ ++{"FB_u", "user,pid,pcpu,pmem,vsz,rss,tt,stat,start,time,command"}, /* FreeBSD u */ ++{"FB_v", "pid,stat,time,sl,re,pagein,vsz,rss,lim,tsiz,pcpu,pmem,command"}, /* FreeBSD v */ ++ ++{"FD_", "pid,tty,time,comm"}, /* Fictional Debian SysV default */ ++{"FD_f", "user,pid,ppid,start_time,tty,time,comm"}, /* Fictional Debian -f */ ++{"FD_fj", "user,pid,ppid,start_time,tty,time,pgid,sid,comm"}, /* Fictional Debian -jf */ ++{"FD_j", "pid,tty,time,pgid,sid,comm"}, /* Fictional Debian -j */ ++{"FD_l", "flags,state,uid,pid,ppid,priority,nice,vsz,wchan,tty,time,comm"}, /* Fictional Debian -l */ ++{"FD_lj", "flags,state,uid,pid,ppid,priority,nice,vsz,wchan,tty,time,pgid,sid,comm"}, /* Fictional Debian -jl */ ++ ++{"FL5FMT", "f,state,uid,pid,ppid,pcpu,pri,nice,rss,wchan,start,time,command"}, /* Digital -fl */ ++ ++{"FLASK_context", "pid,context,command"}, /* Flask Linux context, --context */ ++ ++{"HP_", "pid,tty,time,comm"}, /* HP default */ ++{"HP_f", "user,pid,ppid,cpu,stime,tty,time,args"}, /* HP -f */ ++{"HP_fl", "flags,state,user,pid,ppid,cpu,intpri,nice,addr,sz,wchan,stime,tty,time,args"}, /* HP -fl */ ++{"HP_l", "flags,state,uid,pid,ppid,cpu,intpri,nice,addr,sz,wchan,tty,time,comm"}, /* HP -l */ ++ ++{"J390", "pid,sid,pgrp,tname,atime,args"}, /* OS/390 -j */ ++{"JFMT", "user,pid,ppid,pgid,sess,jobc,state,tname,cputime,command"}, /* Digital j and -j */ ++{"L5FMT", "f,state,uid,pid,ppid,c,pri,nice,addr,sz,wchan,tt,time,ucmd"}, /* Digital -l */ ++{"LFMT", "uid,pid,ppid,cp,pri,nice,vsz,rss,wchan,state,tname,cputime,command"}, /* Digital l */ ++ ++{"OL_X", "pid,start_stack,esp,eip,timeout,alarm,stat,tname,bsdtime,args"}, /* Old i386 Linux X */ ++{"OL_j", "ppid,pid,pgid,sid,tname,tpgid,stat,uid,bsdtime,args"}, /* Old Linux j */ ++{"OL_l", "flags,uid,pid,ppid,priority,nice,vsz,rss,wchan,stat,tname,bsdtime,args"}, /* Old Linux l */ ++{"OL_m", "pid,tname,majflt,minflt,m_trs,m_drs,m_size,m_swap,rss,m_share,vm_lib,m_dt,args"}, /* Old Linux m */ ++{"OL_s", "uid,pid,pending,sig_block,sig_ignore,caught,stat,tname,bsdtime,args"}, /* Old Linux s */ ++{"OL_u", "user,pid,pcpu,pmem,vsz,rss,tname,stat,start_time,bsdtime,args"}, /* Old Linux u */ ++{"OL_v", "pid,tname,stat,bsdtime,maj_flt,m_trs,m_drs,rss,pmem,args"}, /* Old Linux v */ ++ ++{"RD_", "pid,tname,state,bsdtime,comm"}, /* Real Debian default */ ++{"RD_f", "uid,pid,ppid,start_time,tname,bsdtime,args"}, /* Real Debian -f */ ++{"RD_fj", "uid,pid,ppid,start_time,tname,bsdtime,pgid,sid,args"}, /* Real Debian -jf */ ++{"RD_j", "pid,tname,state,bsdtime,pgid,sid,comm"}, /* Real Debian -j */ ++{"RD_l", "flags,state,uid,pid,ppid,priority,nice,wchan,tname,bsdtime,comm"}, /* Real Debian -l */ ++{"RD_lj", "flags,state,uid,pid,ppid,priority,nice,wchan,tname,bsdtime,pgid,sid,comm"}, /* Real Debian -jl */ ++ ++{"RUSAGE", "minflt,majflt,nswap,inblock,oublock,msgsnd,msgrcv,nsigs,nvcsw,nivcsw"}, /* Digital -o "RUSAGE" */ ++{"SCHED", "user,pcpu,pri,usrpri,nice,psxpri,psr,policy,pset"}, /* Digital -o "SCHED" */ ++{"SFMT", "uid,pid,cursig,sig,sigmask,sigignore,sigcatch,stat,tname,command"}, /* Digital s */ ++ ++{"Std_f", "uid_hack,pid,ppid,c,stime,tname,time,cmd"}, /* new -f */ ++{"Std_fl", "f,s,uid_hack,pid,ppid,c,opri,ni,addr,sz,wchan,stime,tname,time,cmd"}, /* -fl */ ++{"Std_l", "f,s,uid,pid,ppid,c,opri,ni,addr,sz,wchan,tname,time,ucmd"}, /* new -l */ ++ ++{"THREAD", "user,pcpu,pri,scnt,wchan,usertime,systime"}, /* Digital -o "THREAD" */ ++{"UFMT", "uname,pid,pcpu,pmem,vsz,rss,tt,state,start,time,command"}, /* Digital u */ ++{"VFMT", "pid,tt,state,time,sl,pagein,vsz,rss,pcpu,pmem,command"}, /* Digital v */ ++{"~", "~"} /* NULL would ruin alphabetical order */ ++}; ++ ++static const int macro_array_count = sizeof(macro_array)/sizeof(macro_struct); ++ ++ ++/*************************** AIX formats ********************/ ++/* Convert AIX format codes to normal format specifiers. */ ++static const aix_struct aix_array[] = { ++{'C', "pcpu", "%CPU"}, ++{'G', "group", "GROUP"}, ++{'P', "ppid", "PPID"}, ++{'U', "user", "USER"}, ++{'a', "args", "COMMAND"}, ++{'c', "comm", "COMMAND"}, ++{'g', "rgroup", "RGROUP"}, ++{'n', "nice", "NI"}, ++{'p', "pid", "PID"}, ++{'r', "pgid", "PGID"}, ++{'t', "etime", "ELAPSED"}, ++{'u', "ruser", "RUSER"}, ++{'x', "time", "TIME"}, ++{'y', "tty", "TTY"}, ++{'z', "vsz", "VSZ"}, ++{'~', "~", "~"} /* NULL would ruin alphabetical order */ ++}; ++static const int aix_array_count = sizeof(aix_array)/sizeof(aix_struct); ++ ++ ++/********************* sorting ***************************/ ++/* Convert short sorting codes to normal format specifiers. */ ++static const shortsort_struct shortsort_array[] = { ++{'C', "pcpu" }, ++{'G', "tpgid" }, ++{'J', "cstime" }, ++/* {'K', "stime" }, */ /* conflict, system vs. start time */ ++{'M', "maj_flt" }, ++{'N', "cmaj_flt" }, ++{'P', "ppid" }, ++{'R', "resident" }, ++{'S', "share" }, ++{'T', "start_time" }, ++{'U', "uid" }, /* euid */ ++{'c', "cmd" }, ++{'f', "flags" }, ++{'g', "pgrp" }, ++{'j', "cutime" }, ++{'k', "utime" }, ++{'m', "min_flt" }, ++{'n', "cmin_flt" }, ++{'o', "session" }, ++{'p', "pid" }, ++{'r', "rss" }, ++{'s', "size" }, ++{'t', "tty" }, ++{'u', "user" }, ++{'v', "vsize" }, ++{'y', "priority" }, /* nice */ ++{'~', "~" } /* NULL would ruin alphabetical order */ ++}; ++static const int shortsort_array_count = sizeof(shortsort_array)/sizeof(shortsort_struct); ++ ++ ++/*********** print format_array **********/ ++/* called by the parser in another file */ ++void print_format_specifiers(void){ ++ const format_struct *walk = format_array; ++ while(*(walk->spec) != '~'){ ++ if(walk->pr != pr_nop) printf("%-12.12s %-8.8s\n", walk->spec, walk->head); ++ walk++; ++ } ++} ++ ++/************ comparison functions for bsearch *************/ ++ ++static int compare_format_structs(const void *a, const void *b){ ++ return strcmp(((const format_struct*)a)->spec,((const format_struct*)b)->spec); ++} ++ ++static int compare_macro_structs(const void *a, const void *b){ ++ return strcmp(((const macro_struct*)a)->spec,((const macro_struct*)b)->spec); ++} ++ ++/******** look up structs as needed by the sort & format parsers ******/ ++ ++const shortsort_struct *search_shortsort_array(const int findme){ ++ const shortsort_struct *walk = shortsort_array; ++ while(walk->desc != '~'){ ++ if(walk->desc == findme) return walk; ++ walk++; ++ } ++ return NULL; ++} ++ ++const aix_struct *search_aix_array(const int findme){ ++ const aix_struct *walk = aix_array; ++ while(walk->desc != '~'){ ++ if(walk->desc == findme) return walk; ++ walk++; ++ } ++ return NULL; ++} ++ ++const format_struct *search_format_array(const char *findme){ ++ format_struct key; ++ key.spec = findme; ++ return bsearch(&key, format_array, format_array_count, ++ sizeof(format_struct), compare_format_structs ++ ); ++} ++ ++const macro_struct *search_macro_array(const char *findme){ ++ macro_struct key; ++ key.spec = findme; ++ return bsearch(&key, macro_array, macro_array_count, ++ sizeof(macro_struct), compare_macro_structs ++ ); ++} ++ ++static unsigned int active_cols; /* some multiple of screen_cols */ ++ ++/***** Last chance, avoid needless trunctuation. */ ++static void check_header_width(void){ ++ format_node *walk = format_list; ++ unsigned int total = 0; ++ int was_normal = 0; ++ unsigned int i = 0; ++ unsigned int sigs = 0; ++ while(walk){ ++ switch((walk->flags) & CF_JUST_MASK){ ++ default: ++ total += walk->width; ++ total += was_normal; ++ was_normal = 1; ++ break; ++ case CF_SIGNAL: ++ sigs++; ++ total += walk->width; ++ total += was_normal; ++ was_normal = 1; ++ break; ++ case CF_UNLIMITED: /* could chop this a bit */ ++ if(walk->next) total += walk->width; ++ else total += 3; /* not strlen(walk->name) */ ++ total += was_normal; ++ was_normal = 1; ++ break; ++ case 0: /* AIX */ ++ total += walk->width; ++ was_normal = 0; ++ break; ++ } ++ walk = walk->next; ++ } ++ for(;;){ ++ i++; ++ active_cols = screen_cols * i; ++ if(active_cols>=total) break; ++ if(screen_cols*i >= OUTBUF_SIZE/2) break; /* can't go over */ ++ } ++ wide_signals = (total+sigs*7 <= active_cols); ++} ++ ++ ++/********** show one process (NULL proc prints header) **********/ ++ ++//#define SPACE_AMOUNT page_size ++#define SPACE_AMOUNT 144 ++ ++static char *saved_outbuf; ++ ++void show_one_proc(const proc_t *restrict const p, const format_node *restrict fmt){ ++ /* unknown: maybe set correct & actual to 1, remove +/- 1 below */ ++ int correct = 0; /* screen position we should be at */ ++ int actual = 0; /* screen position we are at */ ++ int amount = 0; /* amount of text that this data is */ ++ int leftpad = 0; /* amount of space this column _could_ need */ ++ int space = 0; /* amount of space we actually need to print */ ++ int dospace = 0; /* previous column determined that we need a space */ ++ int legit = 0; /* legitimately stolen extra space */ ++ int sz = 0; /* real size of data in outbuffer */ ++ int tmpspace = 0; ++ char *restrict const outbuf = saved_outbuf; ++ static int did_stuff = 0; /* have we ever printed anything? */ ++ ++ if(unlikely(-1==(long)p)){ /* true only once, at the end */ ++ if(did_stuff) return; ++ /* have _never_ printed anything, but might need a header */ ++ if(!--lines_to_next_header){ ++ lines_to_next_header = header_gap; ++ show_one_proc(NULL,fmt); ++ } ++ /* fprintf(stderr, "No processes available.\n"); */ /* legal? */ ++ exit(1); ++ } ++ if(likely(p)){ /* not header, maybe we should call ourselves for it */ ++ if(unlikely(!--lines_to_next_header)){ ++ lines_to_next_header = header_gap; ++ show_one_proc(NULL,fmt); ++ } ++ } ++ did_stuff = 1; ++ if(unlikely(active_cols>(int)OUTBUF_SIZE)) fprintf(stderr,"Fix bigness error.\n"); ++ ++ /* print row start sequence */ ++ for(;;){ ++ legit = 0; ++ /* set width suggestion which might be ignored */ ++// if(likely(fmt->next)) max_rightward = fmt->width; ++// else max_rightward = active_cols-((correct>actual) ? correct : actual); ++ ++ if(likely(fmt->next)){ ++ max_rightward = fmt->width; ++ tmpspace = 0; ++ }else{ ++ tmpspace = correct-actual; ++ if (tmpspace<1){ ++ tmpspace = dospace; ++ max_rightward = active_cols-actual-tmpspace; ++ }else{ ++ max_rightward = active_cols - ( (correct>actual) ? correct : actual ); ++ } ++ } ++ max_leftward = fmt->width + actual - correct; /* TODO check this */ ++ ++// fprintf(stderr, "cols: %d, max_rightward: %d, max_leftward: %d, actual: %d, correct: %d\n", ++// active_cols, max_rightward, max_leftward, actual, correct); ++ ++ /* prepare data and calculate leftpad */ ++ if(likely(p) && likely(fmt->pr)) amount = (*fmt->pr)(outbuf,p); ++ else amount = strlen(strcpy(outbuf, fmt->name)); /* AIX or headers */ ++ ++ switch((fmt->flags) & CF_JUST_MASK){ ++ case 0: /* for AIX, assigned outside this file */ ++ leftpad = 0; ++ break; ++ case CF_LEFT: /* bad */ ++ leftpad = 0; ++ break; ++ case CF_RIGHT: /* OK */ ++ leftpad = fmt->width - amount; ++ if(leftpad < 0) leftpad = 0; ++ break; ++ case CF_SIGNAL: ++ /* if the screen is wide enough, use full 16-character output */ ++ if(wide_signals){ ++ leftpad = 16 - amount; ++ legit = 7; ++ }else{ ++ leftpad = 9 - amount; ++ } ++ if(leftpad < 0) leftpad = 0; ++ break; ++ case CF_USER: /* bad */ ++ leftpad = fmt->width - amount; ++ if(leftpad < 0) leftpad = 0; ++ if(!user_is_number) leftpad = 0; ++ break; ++ case CF_WCHAN: /* bad */ ++ if(wchan_is_number){ ++ leftpad = fmt->width - amount; ++ if(leftpad < 0) leftpad = 0; ++ break; ++ }else{ ++ if ((active_cols-actual-tmpspace)<1) ++ outbuf[1] = '\0'; /* oops, we (mostly) lose this column... */ ++ leftpad = 0; ++ break; ++ } ++ case CF_UNLIMITED: ++ { ++ if(active_cols-actual-tmpspace < 1) ++ outbuf[1] = '\0'; /* oops, we (mostly) lose this column... */ ++ leftpad = 0; ++ break; ++ } ++ default: ++ fprintf(stderr, "bad alignment code\n"); ++ break; ++ } ++ /* At this point: ++ * ++ * correct from previous column ++ * actual from previous column ++ * amount not needed (garbage due to chopping) ++ * leftpad left padding for this column alone (not make-up or gap) ++ * space not needed (will recalculate now) ++ * dospace if we require space between this and the prior column ++ * legit space we were allowed to steal, and thus did steal ++ */ ++ space = correct - actual + leftpad; ++ if(space<1) space=dospace; ++ if(unlikely(space>SPACE_AMOUNT)) space=SPACE_AMOUNT; // only so much available ++ ++ /* real size -- don't forget in 'amount' is number of cells */ ++ sz = strlen(outbuf); ++ ++ /* print data, set x position stuff */ ++ if(unlikely(!fmt->next)){ ++ /* Last column. Write padding + data + newline all together. */ ++ outbuf[sz] = '\n'; ++ fwrite(outbuf-space, space+sz+1, 1, stdout); ++ break; ++ } ++ /* Not the last column. Write padding + data together. */ ++ fwrite(outbuf-space, space+sz, 1, stdout); ++ actual += space+amount; ++ correct += fmt->width; ++ correct += legit; /* adjust for SIGNAL expansion */ ++ if(fmt->pr && fmt->next->pr){ /* neither is AIX filler */ ++ correct++; ++ dospace = 1; ++ }else{ ++ dospace = 0; ++ } ++ fmt = fmt->next; ++ /* At this point: ++ * ++ * correct screen position we should be at ++ * actual screen position we are at ++ * amount not needed ++ * leftpad not needed ++ * space not needed ++ * dospace if have determined that we need a space next time ++ * legit not needed ++ */ ++ } ++} ++ ++ ++#ifdef TESTING ++static void sanity_check(void){ ++ format_struct *fs = format_array; ++ while((fs->spec)[0] != '~'){ ++ if(strlen(fs->head) > fs->width) printf("%d %s\n",strlen(fs->head),fs->spec); ++ fs++; ++ } ++} ++#endif ++ ++ ++void init_output(void){ ++ int outbuf_pages; ++ char *outbuf; ++ ++ switch(page_size){ ++ case 65536: page_shift = 16; break; ++ case 32768: page_shift = 15; break; ++ case 16384: page_shift = 14; break; ++ case 8192: page_shift = 13; break; ++ default: fprintf(stderr, "Unknown page size! (assume 4096)\n"); ++ case 4096: page_shift = 12; break; ++ case 2048: page_shift = 11; break; ++ case 1024: page_shift = 10; break; ++ } ++ ++ // add page_size-1 to round up ++ outbuf_pages = (OUTBUF_SIZE+SPACE_AMOUNT+page_size-1)/page_size; ++ outbuf = mmap( ++ 0, ++ page_size * (outbuf_pages+1), // 1 more, for guard page at high addresses ++ PROT_READ | PROT_WRITE, ++ MAP_PRIVATE | MAP_ANONYMOUS, ++ -1, ++ 0 ++ ); ++ memset(outbuf, ' ', SPACE_AMOUNT); ++ if(SPACE_AMOUNT==page_size) mprotect(outbuf, page_size, PROT_READ); ++ mprotect(outbuf + page_size*outbuf_pages, page_size, PROT_NONE); // gaurd page ++ saved_outbuf = outbuf + SPACE_AMOUNT; ++ // available space: page_size*outbuf_pages-SPACE_AMOUNT ++ ++ seconds_since_1970 = time(NULL); ++ time_of_boot = seconds_since_1970 - seconds_since_boot; ++ ++ meminfo(); ++ ++ check_header_width(); ++} --- procps-3.2.7.orig/debian/patches/20_module_mk_shared.dpatch +++ procps-3.2.7/debian/patches/20_module_mk_shared.dpatch @@ -0,0 +1,36 @@ +#! /bin/sh -e +## 20_module_mk_shared.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Made SHARED variable overwritable + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +diff -urNad procps-3.2.7~/proc/module.mk procps-3.2.7/proc/module.mk +--- procps-3.2.7~/proc/module.mk 2006-06-27 08:24:51.000000000 +1000 ++++ procps-3.2.7/proc/module.mk 2006-06-27 08:25:43.000000000 +1000 +@@ -17,7 +17,7 @@ + # numbers for future use, the ELF soname can be set equal to the + # file name until some future date when a stable ABI is declared. + +-SHARED := 1 ++SHARED ?= 1 + + # for lib$(NAME).so and /usr/include/($NAME) and such + NAME := proc --- procps-3.2.7.orig/debian/patches/50_vmstat_headers.dpatch +++ procps-3.2.7/debian/patches/50_vmstat_headers.dpatch @@ -0,0 +1,149 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50_vmstat_headers.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Headers for disk and slab info Debian bug #436805 +## DP: getopt replacement #408088 + +@DPATCH@ +diff -urNad procps-3.2.7~/vmstat.c procps-3.2.7/vmstat.c +--- procps-3.2.7~/vmstat.c 2007-10-04 22:26:49.000000000 +1000 ++++ procps-3.2.7/vmstat.c 2007-10-04 22:27:07.000000000 +1000 +@@ -29,14 +29,15 @@ + #include "proc/sysinfo.h" + #include "proc/version.h" + +-static unsigned long dataUnit=1024; +-static char szDataUnit [16]; + #define UNIT_B 1 + #define UNIT_k 1000 + #define UNIT_K 1024 + #define UNIT_m 1000000 + #define UNIT_M 1048576 + ++static unsigned long dataUnit=UNIT_K; ++static char szDataUnit[3] = "K"; ++ + #define VMSTAT 0 + #define DISKSTAT 0x00000001 + #define VMSUMSTAT 0x00000002 +@@ -354,6 +355,7 @@ + if ((fDiskstat=fopen("/proc/diskstats", "rb"))){ + fclose(fDiskstat); + ndisks=getdiskstat(&disks,&partitions); ++ if (!moreheaders) diskheader(); + for(k=0; k0)?tmp:22); --- procps-3.2.7.orig/debian/patches/10_top_no_openproc.dpatch +++ procps-3.2.7/debian/patches/10_top_no_openproc.dpatch @@ -0,0 +1,23 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_top_no_openproc.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Exit top if cannot openproc #378695 + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2009-01-09 17:04:25.000000000 +1100 ++++ procps-3.2.7/top.c 2009-01-09 17:43:06.000000000 +1100 +@@ -1097,6 +1097,12 @@ + else + PT = openproc(flags); + ++ if (PT==NULL) { ++ std_err(strerror(errno)); ++ exit(1); ++ } ++ ++ + // i) Allocated Chunks: *Existing* table; refresh + reuse + if (!(CHKw(Curwin, Show_THREADS))) { + while (curmax < savmax) { --- procps-3.2.7.orig/debian/patches/10_skill_perror.dpatch +++ procps-3.2.7/debian/patches/10_skill_perror.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_skill_perror.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: kill prints perror #468363 + +@DPATCH@ +diff -urNad procps-3.2.7~/skill.c procps-3.2.7/skill.c +--- procps-3.2.7~/skill.c 2008-04-07 10:07:12.000000000 +1000 ++++ procps-3.2.7/skill.c 2008-04-07 10:07:58.000000000 +1000 +@@ -309,6 +309,7 @@ + pid = strtol(argv[argc],&endp,10); + if(!*endp){ + if(!kill((pid_t)pid,signo)) continue; ++ perror("kill"); + exitvalue = 1; + continue; + } --- procps-3.2.7.orig/debian/patches/45_proc_complain_unmounted_proc.dpatch +++ procps-3.2.7/debian/patches/45_proc_complain_unmounted_proc.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 45_proc_complain_unmounted_proc.dpatch by +## +## DP: Complain when /proc/version cannot be found instead of +## DP: exiting silently. + +@DPATCH@ +--- procps-3.2.7/proc/version.cO 2007-08-06 16:18:41.000000000 +0200 ++++ procps-3.2.7/proc/version.c 2007-08-06 16:19:28.000000000 +0200 +@@ -39,8 +39,10 @@ + FILE *fp; + char buf[256]; + +- if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */ ++ if ( (fp=fopen("/proc/version","r")) == NULL) { ++ fprintf(stderr, "Cannot find /proc/version - is /proc mounted?\n"); + exit(1); ++ } + if (fgets(buf, 256, fp) == NULL) { + fprintf(stderr, "Cannot read kernel version from /proc/version\n"); + fclose(fp); --- procps-3.2.7.orig/debian/patches/30_sysinfo_7numbers.dpatch +++ procps-3.2.7/debian/patches/30_sysinfo_7numbers.dpatch @@ -0,0 +1,39 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_sysctl_7numbers.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Adds up 7 cpu numbers not 4; #460331 + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/sysinfo.c procps-3.2.7/proc/sysinfo.c +--- procps-3.2.7~/proc/sysinfo.c 2008-08-10 10:13:50.000000000 +1000 ++++ procps-3.2.7/proc/sysinfo.c 2008-08-10 10:13:50.000000000 +1000 +@@ -122,24 +122,25 @@ + unsigned long long Hertz; + + static void old_Hertz_hack(void){ +- unsigned long long user_j, nice_j, sys_j, other_j; /* jiffies (clock ticks) */ ++ unsigned long long user_j, nice_j, sys_j, other_j, wait_j, hirq_j, sirq_j, stol_j; /* jiffies (clock ticks) */ + double up_1, up_2, seconds; + unsigned long long jiffies; + unsigned h; + char *restrict savelocale; + ++ wait_j = hirq_j = sirq_j = stol_j = 0; + savelocale = setlocale(LC_NUMERIC, NULL); + setlocale(LC_NUMERIC, "C"); + do{ + FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_1); + /* uptime(&up_1, NULL); */ + FILE_TO_BUF(STAT_FILE,stat_fd); +- sscanf(buf, "cpu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j); ++ sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu %Lu", &user_j, &nice_j, &sys_j, &other_j, &wait_j, &hirq_j, &sirq_j, &stol_j); + FILE_TO_BUF(UPTIME_FILE,uptime_fd); sscanf(buf, "%lf", &up_2); + /* uptime(&up_2, NULL); */ + } while((long long)( (up_2-up_1)*1000.0/up_1 )); /* want under 0.1% error */ + setlocale(LC_NUMERIC, savelocale); +- jiffies = user_j + nice_j + sys_j + other_j; ++ jiffies = user_j + nice_j + sys_j + other_j + wait_j + hirq_j + sirq_j + stol_j ; + seconds = (up_1 + up_2) / 2; + h = (unsigned)( (double)jiffies/seconds/smp_num_cpus ); + /* actual values used by 2.4 kernels: 32 64 100 128 1000 1024 1200 */ --- procps-3.2.7.orig/debian/patches/10_top_uid_length.dpatch +++ procps-3.2.7/debian/patches/10_top_uid_length.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_top_uid_length.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make the uid length 5 not 4 #426782 + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2009-01-08 10:22:37.000000000 +1100 ++++ procps-3.2.7/top.c 2009-01-08 10:23:07.000000000 +1100 +@@ -1222,7 +1222,7 @@ + { "AaAa", " PID", " %5u", -1, -1, SF(PID), "Process Id", L_NONE }, + { "BbBb", " PPID", " %5u", -1, -1, SF(PPD), "Parent Process Pid", L_EITHER }, + { "CcQq", " RUSER ", " %-8.8s", -1, -1, SF(URR), "Real user name", L_RUSER }, +- { "DdCc", " UID", " %4u", -1, -1, SF(UID), "User Id", L_NONE }, ++ { "DdCc", " UID", " %5u", -1, -1, SF(UID), "User Id", L_NONE }, + { "EeDd", " USER ", " %-8.8s", -1, -1, SF(URE), "User Name", L_EUSER }, + { "FfNn", " GROUP ", " %-8.8s", -1, -1, SF(GRP), "Group Name", L_GROUP }, + { "GgGg", " TTY ", " %-8.8s", 8, -1, SF(TTY), "Controlling Tty", L_stat }, --- procps-3.2.7.orig/debian/patches/10_watch.1.dpatch +++ procps-3.2.7/debian/patches/10_watch.1.dpatch @@ -0,0 +1,101 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_watch.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup of manual page + +@DPATCH@ +diff -urNad procps-3.2.7~/watch.1 procps-3.2.7/watch.1 +--- procps-3.2.7~/watch.1 2008-04-07 11:12:26.000000000 +1000 ++++ procps-3.2.7/watch.1 2008-04-07 11:20:26.000000000 +1000 +@@ -2,44 +2,53 @@ + .SH NAME + watch \- execute a program periodically, showing output fullscreen + .SH SYNOPSIS ++.na + .B watch +-.I [\-dhvt] [\-n ] [\-\-differences[=cumulative]] [\-\-help] [\-\-interval=] [\-\-no\-title] [\-\-version] ++.RB [ \-dhvt ] ++.RB [ \-n ++.IR seconds ] ++.RB [ \-\-differences[=\fIcumulative\fP]] ++.RB [ \-\-help ] ++.RB [ \-\-interval=\fIseconds\fP] ++.RB [ \-\-no\-title ] ++.RB [ \-\-version ] ++.I command + .SH DESCRIPTION +-.BR watch ++.B watch + runs + .I command + repeatedly, displaying its output (the first screenfull). This allows you to + watch the program output change over time. By default, the program is run + every 2 seconds; use +-.I -n ++.B \-n + or +-.I --interval ++.B \-\-interval + to specify a different interval. + .PP + The +-.I -d ++.B \-d + or +-.I --differences ++.B \-\-differences + flag will highlight the differences between successive updates. The +-.I --cumulative ++.B \-\-cumulative + option makes highlighting "sticky", presenting a running display of all + positions that have ever changed. The +-.I -t ++.B \-t + or +-.I --no-title ++.B \-\-no\-title + option turns off the header showing the interval, command, and current + time at the top of the display, as well as the following blank line. + .PP +-.BR watch ++.B watch + will run until interrupted. + .SH NOTE + Note that + .I command +-is given to "sh -c" ++is given to "sh \-c" + which means that you may need to use extra quoting to get the desired effect. + .PP + Note that POSIX option processing is used (i.e., option processing stops at +-the first non-option argument). This means that flags after ++the first non\-option argument). This means that flags after + .I command + don't get interpreted by + .BR watch +@@ -61,20 +70,20 @@ + To see the effects of quoting, try these out + .IP + watch echo $$ +-.IP ++.br + watch echo '$$' +-.IP ++.br + watch echo "'"'$$'"'" + .PP + You can watch for your administrator to install the latest kernel with + .IP +-watch uname -r ++watch uname \-r + .PP + (Just kidding.) + .SH BUGS + Upon terminal resize, the screen will not be correctly repainted until the + next scheduled update. All +-.I --differences ++.B \-\-differences + highlighting is lost on that update as well. + .PP + Non-printing characters are stripped from program output. Use "cat -v" as --- procps-3.2.7.orig/debian/patches/40_gnu-kbsd-version.dpatch +++ procps-3.2.7/debian/patches/40_gnu-kbsd-version.dpatch @@ -0,0 +1,40 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40_gnu-kbsd-version.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Rework version parsing so its ok with other OSes + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/version.c procps-3.2.7/proc/version.c +--- procps-3.2.7~/proc/version.c 2006-06-27 08:55:32.000000000 +1000 ++++ procps-3.2.7/proc/version.c 2006-06-27 09:02:25.000000000 +1000 +@@ -35,15 +35,23 @@ + + static void init_Linux_version(void) __attribute__((constructor)); + static void init_Linux_version(void) { +- static struct utsname uts; + int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */ ++ FILE *fp; ++ char buf[256]; + +- if (uname(&uts) == -1) /* failure implies impending death */ +- exit(1); +- if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3) ++ if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */ ++ exit(1); ++ if (fgets(buf, 256, fp) == NULL) { ++ fprintf(stderr, "Cannot read kernel version from /proc/version\n"); ++ fclose(fp); ++ exit(1); ++ } ++ fclose(fp); ++ if (sscanf(buf, "Linux version %d.%d.%d", &x, &y, &z) < 3) + fprintf(stderr, /* *very* unlikely to happen by accident */ + "Non-standard uts for running kernel:\n" +- "release %s=%d.%d.%d gives version code %d\n", +- uts.release, x, y, z, LINUX_VERSION(x,y,z)); ++ "release %s=%d.%d.%d gives version code %d\n", ++ buf, ++ x, y, z, LINUX_VERSION(x,y,z)); + linux_version_code = LINUX_VERSION(x, y, z); + } --- procps-3.2.7.orig/debian/patches/50_pgrep.1.dpatch +++ procps-3.2.7/debian/patches/50_pgrep.1.dpatch @@ -0,0 +1,211 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 50_pgrep.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup pgrep manual page #282168 +## DP: Uses .BR for see also section #437678 + +@DPATCH@ +diff -urNad procps-3.2.7~/pgrep.1 procps-3.2.7/pgrep.1 +--- procps-3.2.7~/pgrep.1 2008-04-07 11:22:03.000000000 +1000 ++++ procps-3.2.7/pgrep.1 2008-04-07 11:22:16.000000000 +1000 +@@ -2,35 +2,39 @@ + .\" Licensed under version 2 of the GNU General Public License. + .\" Copyright 2000 Kjetil Torgrim Homme + .\" +-.TH PGREP 1 "June 25, 2000" "Linux" "Linux User's Manual" ++.TH PGREP 1 "October 5, 2007" "Linux" "Linux User's Manual" + .SH NAME + pgrep, pkill \- look up or signal processes based on name and other attributes + + .SH SYNOPSIS +-pgrep [\-cflvx] [\-d \fIdelimiter\fP] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...] +-.br +- [\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...] +-.br +- [\-t \fIterm\fP,...] [\fIpattern\fP] ++.na ++\fBpgrep\fR [\fB\-cflvx\fR] [\fB\-d\ \fIdelimiter\fR] [\fB\-n\fR|\fB\-o\fR] \ ++[\fB\-P\ \fIppid\fR,...] [\fB\-g\ \fIpgrp\fR,...] [\fB\-s\ \fIsid\fR,...] \ ++[\fB\-u\ \fIeuid\fR,...] [\fB\-U\ \fIuid\fR,...] [\fB\-G\ \fIgid\fR,...] \ ++[\fB\-t\ \fIterm\fR,...] [\fIpattern\fR] + +-pkill [\-\fIsignal\fP] [\-fvx] [\-n|\-o] [\-P \fIppid\fP,...] [\-g \fIpgrp\fP,...] +-.br +- [\-s \fIsid\fP,...] [\-u \fIeuid\fP,...] [\-U \fIuid\fP,...] [\-G \fIgid\fP,...] +-.br +- [\-t \fIterm\fP,...] [\fIpattern\fP] ++.HP ++\fBpkill\fR [\fB\-\fIsignal\fR] [\fB\-fvx\fR] [\fB\-n\fR|\fB\-o\fR] \ ++[\fB\-P\ \fIppid\fR,...] [\fB\-g\ \fIpgrp\fR,...] [\fB\-s\ \fIsid\fR,...] \ ++[\fB\-u\ \fIeuid\fR,...] [\fB\-U\ \fIuid\fR,...] [\fB\-G\ \fIgid\fR,...] \ ++[\fB\-t\ \fIterm\fR,...] [\fIpattern\fR] + + .SH DESCRIPTION + \fBpgrep\fP looks through the currently running processes and lists the + process IDs which matches the selection criteria to stdout. All + the criteria have to match. For example, + +-pgrep -u root sshd ++.IP ++$ pgrep \-u root sshd + ++.PP + will only list the processes called \fBsshd\fP AND owned by \fBroot\fP. + On the other hand, + +-pgrep -u root,daemon ++.IP ++$ pgrep \-u root,daemon + ++.PP + will list the processes owned by \fBroot\fP OR \fBdaemon\fP. + + \fBpkill\fP will send the specified signal (by default \fBSIGTERM\fP) +@@ -38,18 +42,18 @@ + + .SH OPTIONS + .TP +-\-c ++\fB\-c\fR + Suppress normal output; instead print a count of matching processes. + .TP +-\-d \fIdelimiter\fP ++\fB\-d \fIdelimiter\fP + Sets the string used to delimit each process ID in the output (by + default a newline). (\fBpgrep\fP only.) + .TP +-\-f ++\fB\-f\fR + The \fIpattern\fP is normally only matched against the process name. +-When \-f is set, the full command line is used. ++When \fB\-f\fR is set, the full command line is used. + .TP +-\-g \fIpgrp\fP,... ++\fB\-g \fIpgrp\fP,... + Only match processes in the process group IDs listed. Process group 0 + is translated into \fBpgrep\fP's or \fBpkill\fP's own process group. + .TP +@@ -57,40 +61,40 @@ + Only match processes whose real group ID is listed. Either the + numerical or symbolical value may be used. + .TP +-\-l ++\fB\-l\fR + List the process name as well as the process ID. (\fBpgrep\fP only.) + .TP +-\-n ++\fB\-n\fR + Select only the newest (most recently started) of the matching + processes. + .TP +-\-o ++\fB\-o\fR + Select only the oldest (least recently started) of the matching + processes. + .TP +-\-P \fIppid\fP,... ++\fB\-P \fIppid\fP,... + Only match processes whose parent process ID is listed. + .TP +-\-s \fIsid\fP,... ++\fB\-s \fIsid\fP,... + Only match processes whose process session ID is listed. Session ID 0 + is translated into \fBpgrep\fP's or \fBpkill\fP's own session ID. + .TP +-\-t \fIterm\fP,... ++\fB\-t \fIterm\fP,... + Only match processes whose controlling terminal is listed. The + terminal name should be specified without the "/dev/" prefix. + .TP +-\-u \fIeuid\fP,... ++\fB\-u \fIeuid\fP,... + Only match processes whose effective user ID is listed. Either the + numerical or symbolical value may be used. + .TP +-\-U \fIuid\fP,... ++\fB\-U \fIuid\fP,... + Only match processes whose real user ID is listed. Either the + numerical or symbolical value may be used. + .TP +-\-v ++\fB\-v\fR + Negates the matching. + .TP +-\-x ++\fB\-x\fR + Only match processes whose name (or command line if \-f is specified) + \fBexactly\fP match the \fIpattern\fP. + .TP +@@ -107,32 +111,40 @@ + .SH EXAMPLES + Example 1: Find the process ID of the \fBnamed\fP daemon: + +-unix$ pgrep \-u root named ++.IP ++$ pgrep \-u root named + ++.PP + Example 2: Make \fBsyslog\fP reread its configuration file: + +-unix$ pkill \-HUP syslogd ++.IP ++$ pkill \-HUP syslogd + ++.PP + Example 3: Give detailed information on all \fBxterm\fP processes: + +-unix$ ps \-fp $(pgrep \-d, \-x xterm) ++.IP ++$ ps \-fp $(pgrep \-d, \-x xterm) + ++.PP + Example 4: Make all \fBnetscape\fP processes run nicer: + +-unix$ renice +4 `pgrep netscape` ++.IP ++$ renice +4 `pgrep netscape` + + .SH "EXIT STATUS" ++.PD 0 + .TP +-.I "0" ++.I 0 + One or more processes matched the criteria. + .TP +-.I "1" ++.I 1 + No processes matched. + .TP +-.I "2" ++.I 2 + Syntax error in the command line. + .TP +-.I "3" ++.I 3 + Fatal error: out of memory etc. + + .SH NOTES +@@ -144,13 +156,19 @@ + itself as a match. + + .SH BUGS +-The options \-n and \-o and \-v can not be combined. Let me know if +-you need to do this. ++The options \fB\-n\fP and \fB\-o\fP and \fB\-v\fP can not be combined. ++Let me know if you need to do this. + + Defunct processes are reported. + + .SH "SEE ALSO" +-ps(1) regex(7) signal(7) killall(1) skill(1) kill(1) kill(2) ++.BR ps (1), ++.BR regex (7), ++.BR signal (7), ++.BR killall (1), ++.BR skill (1), ++.BR kill (1), ++.BR kill (2) + + .SH STANDARDS + \fBpkill\fP and \fBpgrep\fP were introduced in Sun's Solaris 7. This --- procps-3.2.7.orig/debian/patches/10_w_time.dpatch +++ procps-3.2.7/debian/patches/10_w_time.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_w_time.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Let fprintf print locale-friendly seconds #252575 + +@DPATCH@ +diff -urNad procps-3.2.7~/w.c procps-3.2.7/w.c +--- procps-3.2.7~/w.c 2009-01-09 15:56:04.000000000 +1100 ++++ procps-3.2.7/w.c 2009-01-09 16:14:56.000000000 +1100 +@@ -83,7 +83,7 @@ + else if (t > 60) /* > 1 minute */ + fprintf(fout, " %2lu:%02u ", t/60, (unsigned) t%60); + else +- fprintf(fout, " %2lu.%02us", t, centi_sec); ++ fprintf(fout, " %2lu.%02us", t, centi_sec); + } + + /**** stat the device file to get an idle time */ --- procps-3.2.7.orig/debian/patches/00list +++ procps-3.2.7/debian/patches/00list @@ -0,0 +1,51 @@ +10_free.1 +10_pmap.1 +10_ps.1 +10_skill.1 +10_skill_perror +10_slabtop +10_sysctl.8 +10_sysctl_malloclen +10_sysctl_options +10_tload.1 +10_top_irix +10_top_no_openproc +10_top_stdineof +10_top_uid_length +10_uptime.1 +10_vmstat.8 +10_watch.1 +10_w_time +20_kill.1 +20_kill_warncr +20_module_mk_shared +20_sysinfo_c +20_top_manpage +20_top_c_resize +20_w-bassman +30_top.1_cpustate +20_watch_8bitchar +30_library_map_freeproc +30_pgrep_start_time +30_readproc_c +30_sysinfo_7numbers +30_tload_no_optargs +30_w.1 +30_w-columns +30_watch_exec_beep +35_path_max +40_gnu-kbsd-version +40_pgrep_coption +40_ps_cgroup_display +40_watch_precision_time +45_proc_complain_unmounted_proc +45_top_exitcode +45_vmstat_exitcode +50_dev_null_makefile_fix +50_pgrep.1 +50_top_mintime +50_vmstat_headers +55_pgrep_usage_exitcode +55_top_highlight +60_relaxed_100hz_tick_detection +60_top_nohz --- procps-3.2.7.orig/debian/patches/40_watch_precision_time.dpatch +++ procps-3.2.7/debian/patches/40_watch_precision_time.dpatch @@ -0,0 +1,217 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40_watch_precision_time.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Add precision wait time option -p #183486 + +@DPATCH@ +diff -urNad procps-3.2.7~/watch.1 procps-3.2.7/watch.1 +--- procps-3.2.7~/watch.1 2009-01-11 12:27:23.000000000 +1100 ++++ procps-3.2.7/watch.1 2009-01-11 12:28:49.000000000 +1100 +@@ -4,7 +4,7 @@ + .SH SYNOPSIS + .na + .B watch +-.RB [ \-bdehvtx ] ++.RB [ \-bdehpvtx ] + .RB [ \-n + .IR seconds ] + .RB [ \-\-beep ] +@@ -14,6 +14,7 @@ + .RB [ \-\-help ] + .RB [ \-\-interval=\fIseconds\fP] + .RB [ \-\-no\-title ] ++.RB [ \-\-precise ] + .RB [ \-\-version ] + .I command + .SH DESCRIPTION +@@ -27,7 +28,24 @@ + .B \-n + or + .B \-\-interval +-to specify a different interval. ++to specify a different interval. Normally, this interval is interpreted ++as the amout of time between the completion of one run of ++.I command ++and the beginning of the next run. However, with the ++.I \-p ++or ++.I \-\-precise ++option, you can make ++.BR watch ++attempt to run ++.I command ++every ++.I interval ++seconds. Try it with ++.B ntptime ++and notice how the fractional seconds stays ++(nearly) the same, as opposed to normal mode where they continuously ++increase. + .PP + The + .B \-d +@@ -97,11 +115,21 @@ + .br + watch echo "'"'$$'"'" + .PP ++To see the effect of precision time keeping, try adding ++.I \-p ++to ++.IP ++watch \-n 10 sleep 1 ++.PP + You can watch for your administrator to install the latest kernel with + .IP + watch uname \-r + .PP +-(Just kidding.) ++(Note that ++.I \-p ++isn't guaranteed to work across reboots, especially in the face of ++.B ntpdate ++or other bootup time-changing mechanisms) + .SH BUGS + Upon terminal resize, the screen will not be correctly repainted until the + next scheduled update. All +@@ -110,6 +138,22 @@ + .PP + Non-printing characters are stripped from program output. Use "cat -v" as + part of the command pipeline if you want to see them. ++.PP ++.I \-\-precise ++mode doesn't yet have advanced temporal distortion technology to ++compensate for a ++.I command ++that takes more than ++.I interval ++seconds to execute. ++.B watch ++also can get into a state where it rapid-fires as many executions of ++.I command ++as it can to catch up from a previous executions running longer than ++.I interval ++(for example, ++.B netstat ++taking ages on a DNS lookup). + .SH AUTHORS + The original + .B watch +@@ -117,3 +161,7 @@ + corrections by Francois Pinard. It was reworked and new features added by + Mike Coleman in 1999. The beep, exec, and error handling + features were added by Morty Abzug in 2008. ++On a not so dark and stormy morning ++in March of 2003, Anthony DeRobertis got sick of ++his watches that should update every minute eventually updating many ++seconds after the minute started, and added microsecond precision. +diff -urNad procps-3.2.7~/watch.c procps-3.2.7/watch.c +--- procps-3.2.7~/watch.c 2009-01-11 12:27:23.000000000 +1100 ++++ procps-3.2.7/watch.c 2009-01-11 12:28:37.000000000 +1100 +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -39,13 +40,14 @@ + {"beep", no_argument, 0, 'b'}, + {"errexit", no_argument, 0, 'e'}, + {"exec", no_argument, 0, 'x'}, ++ {"precise", no_argument, 0, 'p'}, + {"no-title", no_argument, 0, 't'}, + {"version", no_argument, 0, 'v'}, + {0, 0, 0, 0} + }; + + static char usage[] = +- "Usage: %s [-bdhntvx] [--beep] [--differences[=cumulative]] [--exec] [--help] [--interval=] [--no-title] [--version] \n"; ++ "Usage: %s [-bdhnptvx] [--beep] [--differences[=cumulative]] [--exec] [--help] [--interval=] [--no-title] [--version] \n"; + + static char *progname; + +@@ -54,6 +56,7 @@ + static int screen_size_changed = 0; + static int first_screen = 1; + static int show_title = 2; // number of lines used, 2 or 0 ++static int precise_timekeeping = 0; + + #define min(x,y) ((x) > (y) ? (y) : (x)) + +@@ -138,6 +141,15 @@ + } + } + ++/* get current time in usec */ ++typedef unsigned long long watch_usec_t; ++#define USECS_PER_SEC (1000000ull) ++watch_usec_t get_time_usec() { ++ struct timeval now; ++ gettimeofday(&now, NULL); ++ return USECS_PER_SEC*now.tv_sec + now.tv_usec; ++} ++ + int + main(int argc, char *argv[]) + { +@@ -152,6 +164,8 @@ + char *command; + char **command_argv; + int command_length = 0; /* not including final \0 */ ++ watch_usec_t next_loop; /* next loop time in us, used for precise time ++ keeping only */ + int pipefd[2]; + int status; + pid_t child; +@@ -159,7 +173,7 @@ + setlocale(LC_ALL, ""); + progname = argv[0]; + +- while ((optc = getopt_long(argc, argv, "+bed::hn:vtx", longopts, (int *) 0)) ++ while ((optc = getopt_long(argc, argv, "+bed::hn:pvtx", longopts, (int *) 0)) + != EOF) { + switch (optc) { + case 'b': +@@ -194,6 +208,9 @@ + interval = ~0u/1000000; + } + break; ++ case 'p': ++ precise_timekeeping = 1; ++ break; + case 'v': + option_version = 1; + break; +@@ -217,6 +234,7 @@ + fputs(" -e, --errexit\t\t\t\texit watch if the command has a non-zero exit\n", stderr); + fputs(" -h, --help\t\t\t\tprint a summary of the options\n", stderr); + fputs(" -n, --interval=\t\tseconds to wait between updates\n", stderr); ++ fputs(" -p, --precise\t\t\t\tprecise timing, ignore command run time\n", stderr); + fputs(" -v, --version\t\t\t\tprint the version number\n", stderr); + fputs(" -t, --no-title\t\t\tturns off showing the header\n", stderr); + fputs(" -x, --exec\t\t\t\tpass command to exec instead of sh\n", stderr); +@@ -256,6 +274,9 @@ + noecho(); + cbreak(); + ++ if (precise_timekeeping) ++ next_loop = get_time_usec(); ++ + for (;;) { + time_t t = time(NULL); + char *ts = ctime(&t); +@@ -400,6 +421,12 @@ + + first_screen = 0; + refresh(); ++ if (precise_timekeeping) { ++ watch_usec_t cur_time = get_time_usec(); ++ next_loop += USECS_PER_SEC*interval; ++ if (cur_time < next_loop) ++ usleep(next_loop - cur_time); ++ } else + usleep(interval * 1000000); + } + --- procps-3.2.7.orig/debian/patches/20_kill.1.dpatch +++ procps-3.2.7/debian/patches/20_kill.1.dpatch @@ -0,0 +1,167 @@ +#! /bin/sh -e +## 20_kill.1.dpatch by Craig Small +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix kill.1 manual page +## DP: Changed may to cannot or might #375739 + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +diff -urNad procps-3.2.7~/kill.1 procps-3.2.7/kill.1 +--- procps-3.2.7~/kill.1 2009-01-09 17:04:24.000000000 +1100 ++++ procps-3.2.7/kill.1 2009-01-09 17:11:37.000000000 +1100 +@@ -10,23 +10,18 @@ + kill \- send a signal to a process + + .SH SYNOPSIS +-.TS +-l l. +-kill pid ... Send SIGTERM to every process listed. +-kill -signal pid ... Send a signal to every process listed. +-kill -s signal pid ... Send a signal to every process listed. +-kill -l List all signal names. +-kill -L List all signal names in a nice table. +-kill -l signal Convert a signal number into a name. +-kill -V,--version Show version of program +-.TE ++\fBkill\fR [ \-\fBsignal\fR | \-s \fBsignal\fR ] \fBpid\fR ... ++.br ++\fBkill\fR [ \-L | -V, \-\-version ] ++.br ++\fBkill\fR \-l [ \fBsignal\fR ] + + .SH DESCRIPTION +-The default signal for kill is TERM. Use -l or -L to list available signals. ++The default signal for kill is TERM. Use \-l or \-L to list available signals. + Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. +-Alternate signals may be specified in three ways: -9 -SIGKILL -KILL. ++Alternate signals may be specified in three ways: \-9 \-SIGKILL \-KILL. + Negative PID values may be used to choose whole process groups; see the +-PGID column in ps command output. A PID of -1 is special; it indicates ++PGID column in ps command output. A PID of \-1 is special; it indicates + all processes except the kill process itself and init. + + .SH SIGNALS +@@ -37,12 +32,11 @@ + lB rB lB lB + lfCW r l l. + Name Num Action Description +-.TH + 0 0 n/a exit code indicates if a signal may be sent + ALRM 14 exit + HUP 1 exit + INT 2 exit +-KILL 9 exit this signal may not be blocked ++KILL 9 exit cannot be blocked + PIPE 13 exit + POLL exit + PROF exit +@@ -50,15 +44,15 @@ + USR1 exit + USR2 exit + VTALRM exit +-STKFLT exit may not be implemented +-PWR ignore may exit on some systems ++STKFLT exit might not be implemented ++PWR ignore might exit on some systems + WINCH ignore + CHLD ignore + URG ignore +-TSTP stop may interact with the shell +-TTIN stop may interact with the shell +-TTOU stop may interact with the shell +-STOP stop this signal may not be blocked ++TSTP stop might interact with the shell ++TTIN stop might interact with the shell ++TTOU stop might interact with the shell ++STOP stop cannot be blocked + CONT restart continue if stopped, otherwise ignore + ABRT 6 core + FPE 8 core +@@ -66,11 +60,11 @@ + QUIT 3 core + SEGV 11 core + TRAP 5 core +-SYS core may not be implemented +-EMT core may not be implemented +-BUS core core dump may fail +-XCPU core core dump may fail +-XFSZ core core dump may fail ++SYS core might not be implemented ++EMT core might not be implemented ++BUS core core dump might fail ++XCPU core core dump might fail ++XFSZ core core dump might fail + .TE + + .SH NOTES +@@ -79,36 +73,30 @@ + the conflict. + + .SH EXAMPLES +- +-.SS +-.B "kill -9 -1" +-.nf ++.TP ++.B kill \-9 \-1 + Kill all processes you can kill. +-.fi +-.PP +-.SS +-.B "kill -l 11" +-.nf ++.TP ++.B kill \-l 11 + Translate number 11 into a signal name. +-.fi +-.PP +-.SS +-.B "kill -L" +-.nf ++.TP ++.B kill -L + List the available signal choices in a nice table. +-.fi +-.PP +-.SS +-.B "kill 123 543 2341 3453" +-.nf ++.TP ++.B kill 123 543 2341 3453 + Send the default signal, SIGTERM, to all those processes. +-.fi +-.PP ++ + .SH "SEE ALSO" +-pkill(1) skill(1) kill(2) renice(1) nice(1) signal(7) killall(1) ++.BR pkill (1), ++.BR skill (1), ++.BR kill (2), ++.BR renice (1), ++.BR nice (1), ++.BR signal (7), ++.BR killall (1). + + .SH STANDARDS +-This command meets appropriate standards. The -L flag is Linux-specific. ++This command meets appropriate standards. The \-L flag is Linux-specific. + + .SH AUTHOR + Albert Cahalan wrote kill in 1999 to replace a --- procps-3.2.7.orig/debian/patches/10_sysctl.8.dpatch +++ procps-3.2.7/debian/patches/10_sysctl.8.dpatch @@ -0,0 +1,149 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_sysctl_8.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: -p flag has OPTIONAL filename (#297144) +## DP: cleanup ssysctl man page #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/sysctl.8 procps-3.2.7/sysctl.8 +--- procps-3.2.7~/sysctl.8 2006-06-26 09:44:20.000000000 +1000 ++++ procps-3.2.7/sysctl.8 2006-06-26 12:42:08.000000000 +1000 +@@ -10,76 +10,108 @@ + .SH NAME + sysctl \- configure kernel parameters at runtime + .SH SYNOPSIS +-.B "sysctl [-n] [-e] variable ..." ++.B sysctl ++.RB [ \-n ] ++.RB [ \-e ] ++.I variable ++\&... + .br +-.B "sysctl [-n] [-e] [-q] -w variable=value ..." ++.B sysctl ++.RB [ \-n ] ++.RB [ \-e ] ++.RB [ \-q ] ++.B \-w ++.IR variable = value ++\&... + .br +-.B "sysctl [-n] [-e] [-q] -p " ++.B sysctl ++.RB [ \-n ] ++.RB [ \-e ] ++.RB [ \-q ] ++.B \-p ++.RI [ filename ] + .br +-.B "sysctl [-n] [-e] -a" ++.B sysctl ++.RB [ \-n ] ++.RB [ \-e ] ++.B \-a + .br +-.B "sysctl [-n] [-e] -A" ++.B sysctl ++.RB [ \-n ] ++.RB [ \-e ] ++.B \-A + .SH DESCRIPTION + .B sysctl + is used to modify kernel parameters at runtime. The parameters available + are those listed under /proc/sys/. Procfs is required for +-.B sysctl(8) ++.B sysctl + support in Linux. You can use +-.B sysctl(8) ++.B sysctl + to both read and write sysctl data. + .SH PARAMETERS + .TP +-.B "variable" ++.I variable + The name of a key to read from. An example is kernel.ostype. The '/' + separator is also accepted in place of a '.'. + .TP +-.B "variable=value" +-To set a key, use the form variable=value, where variable is the key and +-value is the value to set it to. If the value contains quotes or characters ++.IR variable = value ++To set a key, use the form ++.IR variable = value ++where ++.I variable ++is the key and ++.I value ++is the value to set it to. If the value contains quotes or characters + which are parsed by the shell, you may need to enclose the value in double +-quotes. This requires the -w parameter to use. ++quotes. This requires the ++.B \-w ++parameter to use. + .TP +-.B "-n" ++.B \-n + Use this option to disable printing of the key name when printing values. + .TP +-.B "-e" ++.B \-e + Use this option to ignore errors about unknown keys. + .TP +-.B "-N" ++.B \-N + Use this option to only print the names. It may be useful with shells that + have programmable completion. + .TP +-.B "-q" ++.B \-q + Use this option to not display the values set to stdout. + .TP +-.B "-w" ++.B \-w + Use this option when you want to change a sysctl setting. + .TP +-.B "-p" ++.B \-p + Load in sysctl settings from the file specified or /etc/sysctl.conf if none given. + Specifying \- as filename means reading data from standard input. + .TP +-.B "-a" ++.B \-a + Display all values currently available. + .TP +-.B "-A" ++.B \-A + Display all values currently available in table form. + .SH EXAMPLES +-.TP +-/sbin/sysctl -a +-.TP +-/sbin/sysctl -n kernel.hostname +-.TP +-/sbin/sysctl -w kernel.domainname="example.com" +-.TP +-/sbin/sysctl -p /etc/sysctl.conf ++/sbin/sysctl \-a ++.br ++/sbin/sysctl \-n kernel.hostname ++.br ++/sbin/sysctl \-w kernel.domainname="example.com" ++.br ++/sbin/sysctl \-p /etc/sysctl.conf + .SH FILES + .I /proc/sys ++.br + .I /etc/sysctl.conf + .SH SEE ALSO + .BR sysctl.conf (5) + .SH BUGS +-The -A parameter behaves just as -a does. ++The ++.B \-A ++parameter behaves just as ++.B \-a ++does. + .SH AUTHOR + George Staikos, + --- procps-3.2.7.orig/debian/patches/10_free.1.dpatch +++ procps-3.2.7/debian/patches/10_free.1.dpatch @@ -0,0 +1,66 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_free.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: -g flag documented #286900 +## DP: hypen escaped #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/free.1 procps-3.2.7/free.1 +--- procps-3.2.7~/free.1 2004-02-24 08:35:55.000000000 +1100 ++++ procps-3.2.7/free.1 2007-10-04 22:32:20.000000000 +1000 +@@ -5,7 +5,7 @@ + .SH NAME + free \- Display amount of free and used memory in the system + .SH SYNOPSIS +-.BR "free " [ "\-b" " | " "\-k" " | " "\-m" "] [" "\-o" "] [" "\-s" ++.BR "free " [ "\-b" " | " "\-k" " | " "\-m" " | " "\-g" "] [" "\-o" "] [" "\-s" + .I delay + .RB "] [" "\-t" "] [" "\-V" ] + .SH DESCRIPTION +@@ -13,32 +13,34 @@ + memory in the system, as well as the buffers used by the kernel. + The shared memory column should be ignored; it is obsolete. + .SS Options +-The \fB-b\fP switch displays the amount of memory in bytes; the +-\fB-k\fP switch (set by default) displays it in kilobytes; the \fB-m\fP +-switch displays it in megabytes. ++The \fB\-b\fP switch displays the amount of memory in bytes; the ++\fB\-k\fP switch (set by default) displays it in kilobytes; the \fB\-m\fP ++switch displays it in megabytes; the \fB\-g\fP switch displays it in ++gigabytes. + .PP +-The \fB-t\fP switch displays a line containing the totals. ++The \fB\-t\fP switch displays a line containing the totals. + .PP +-The \fB-o\fP switch disables the display of a "buffer adjusted" line. +-If the -o option is not specified, \fBfree\fP subtracts buffer memory ++The \fB\-o\fP switch disables the display of a "buffer adjusted" line. ++If the \-o option is not specified, \fBfree\fP subtracts buffer memory + from the used memory and adds it to the free memory reported. + .PP +-The \fB-s\fP switch activates continuous polling \fIdelay\fP seconds apart. You ++The \fB\-s\fP switch activates continuous polling \fIdelay\fP seconds apart. You + may actually specify any floating point number for \fIdelay\fP, + .BR usleep (3) + is used for microsecond resolution delay times. + .PP + The \fB\-V\fP displays version information. + .SH FILES +-.ta +-.IR /proc/meminfo "\-\- memory information" +-.fi ++.TP ++.I /proc/meminfo ++memory information ++ + + .SH "SEE ALSO" + .BR ps (1), + .BR slabtop (1), + .BR vmstat (8), +-.BR top(1) ++.BR top (1) + + .SH AUTHORS + Written by Brian Edmonds. --- procps-3.2.7.orig/debian/patches/35_path_max.dpatch +++ procps-3.2.7/debian/patches/35_path_max.dpatch @@ -0,0 +1,75 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 35_path_max.dpatch by Madhusudan.C.S +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Uses alloc instead of fixed PATH_MAX value #496274 + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/readproc.c procps-3.2.7/proc/readproc.c +--- procps-3.2.7~/proc/readproc.c 2008-09-09 15:01:09.000000000 +1000 ++++ procps-3.2.7/proc/readproc.c 2008-09-09 15:01:36.000000000 +1000 +@@ -1034,7 +1034,7 @@ + * and filled out proc_t structure. + */ + proc_t * get_proc_stats(pid_t pid, proc_t *p) { +- static char path[PATH_MAX], sbuf[1024]; ++ static char path[32], sbuf[1024]; + struct stat statbuf; + + sprintf(path, "/proc/%d", pid); +diff -urNad procps-3.2.7~/pwdx.c procps-3.2.7/pwdx.c +--- procps-3.2.7~/pwdx.c 2006-06-17 19:29:06.000000000 +1000 ++++ procps-3.2.7/pwdx.c 2008-09-09 15:01:36.000000000 +1000 +@@ -35,7 +35,6 @@ + + int main(int argc, char* argv[]) + { +- char buf[PATH_MAX+1]; + regex_t re; + int i; + +@@ -59,6 +58,7 @@ + + for (i = 1; i < argc; i++) { + if (regexec(&re, argv[i], 0, NULL, 0) != 0) { ++ char buf[27 + strlen (argv[i]) + 1]; // Constant 27 is the length of the error string "pwdx: ... " + snprintf(buf, sizeof buf, "pwdx: invalid process id: %s\n", argv[i]); + die(buf); + } +@@ -68,9 +68,13 @@ + + regfree(&re); + ++ int alloclen = 128; ++ char *pathbuf = malloc(alloclen); ++ + for (i = 1; i < argc; i++) { +- char * s = buf; ++ char * s; + int len; ++ char buf[10 + strlen(argv[i]) + 1]; // Constant 10 is the length of strings "/proc/" + "/cwd" + 1 + + // At this point, all arguments are in the form /proc/nnnn + // or nnnn, so a simple check based on the first char is +@@ -82,7 +86,12 @@ + + // buf contains /proc/nnnn/cwd symlink name on entry, the + // target of that symlink on return +- if ((len = readlink(buf, buf, PATH_MAX)) < 0) { ++ while ((len = readlink(buf, pathbuf, alloclen) == alloclen)) { ++ alloclen *= 2; ++ s = pathbuf = realloc(pathbuf, alloclen); ++ } ++ ++ if (len < 0) { + s = strerror(errno == ENOENT ? ESRCH : errno); + } else { + buf[len] = 0; +@@ -91,5 +100,7 @@ + printf("%s: %s\n", argv[i], s); + } + ++ free(pathbuf); ++ + return 0; + } --- procps-3.2.7.orig/debian/patches/10_vmstat.8.dpatch +++ procps-3.2.7/debian/patches/10_vmstat.8.dpatch @@ -0,0 +1,113 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_vmstat.8.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fixes groff problems +## DP: Removes pslab as it doesnt appear + +@DPATCH@ +diff -urNad procps-3.2.7~/vmstat.8 procps-3.2.7/vmstat.8 +--- procps-3.2.7~/vmstat.8 2009-01-08 10:26:34.000000000 +1100 ++++ procps-3.2.7/vmstat.8 2009-01-09 12:23:21.000000000 +1100 +@@ -1,6 +1,6 @@ + .\" This page Copyright (C) 1994 Henry Ware + .\" Distributed under the GPL, Copyleft 1994. +-.TH VMSTAT 8 "27 July 1994 " "Throatwobbler Ginkgo Labs" "Linux Administrator's Manual" ++.TH VMSTAT 8 "2009 Jan 9" "Throatwobbler Ginkgo Labs" "Linux Administrator's Manual" + .SH NAME + vmstat \- Report virtual memory statistics + .SH SYNOPSIS +@@ -22,32 +22,35 @@ + .RB [ "\-d"] + .br + .B vmstat ++.RB [ "\-D"] ++.br ++.B vmstat + .RB [ "\-p disk partition"] + .br + .B vmstat + .RB [ "\-V" ] + .SH DESCRIPTION + \fBvmstat\fP reports information about processes, memory, paging, +-block IO, traps, and cpu activity. ++block IO, traps, disks and cpu activity. + + The first report produced gives averages since the last reboot. Additional + reports give information on a sampling period of length \fIdelay\fP. + The process and memory reports are instantaneous in either case. + + .SS Options +-The \fB-a\fP switch displays active/inactive memory, given a 2.5.41 kernel or better. ++The \fB\-a\fP switch displays active/inactive memory, given a 2.5.41 kernel or better. + .PP +-The \fB-f\fP switch displays the number of forks since boot. ++The \fB\-f\fP switch displays the number of forks since boot. + This includes the fork, vfork, and clone system calls, and is + equivalent to the total number of tasks created. Each process + is represented by one or more tasks, depending on thread usage. + This display does not repeat. + .PP +-The \fB-m\fP displays slabinfo. ++The \fB\-m\fP displays slabinfo. + .PP +-The \fB-n\fP switch causes the header to be displayed only once rather than periodically. ++The \fB\-n\fP switch causes the header to be displayed only once rather than periodically. + .PP +-The \fB-s\fP switch displays a table of various event counters ++The \fB\-s\fP switch displays a table of various event counters + and memory statistics. This display does not repeat. + .PP + .I delay +@@ -58,13 +61,15 @@ + is the number of updates. If no count is specified and delay is + defined, \fIcount\fP defaults to infinity. + .PP +-The \fB-d\fP reports disk statistics (2.5.70 or above required) ++The \fB\-d\fP reports disk statistics (2.5.70 or above required) + .PP +-The \fB-p\fP followed by some partition name for detailed statistics (2.5.70 or above required) ++The \fB-D\fP reports some summary statistics about disk activity. + .PP +-The \fB-S\fP followed by k or K or m or M switches outputs between 1000, 1024, 1000000, or 1048576 bytes ++The \fB\-p\fP followed by some partition name for detailed statistics (2.5.70 or above required) + .PP +-The \fB-V\fP switch results in displaying version information. ++The \fB\-S\fP followed by k or K or m or M switches outputs between 1000, 1024, 1000000, or 1048576 bytes ++.PP ++The \fB\-V\fP switch results in displaying version information. + .PP + .SH FIELD DESCRIPTION FOR VM MODE + .SS +@@ -81,8 +86,8 @@ + free: the amount of idle memory. + buff: the amount of memory used as buffers. + cache: the amount of memory used as cache. +-inact: the amount of inactive memory. (-a option) +-active: the amount of active memory. (-a option) ++inact: the amount of inactive memory. (\-a option) ++active: the amount of active memory. (\-a option) + .fi + .PP + .SS +@@ -110,9 +115,9 @@ + .B "CPU " + These are percentages of total CPU time. + .nf +-us: Time spent running non-kernel code. (user time, including nice time) ++us: Time spent running non\-kernel code. (user time, including nice time) + sy: Time spent running kernel code. (system time) +-id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time. ++id: Time spent idle. Prior to Linux 2.5.41, this includes IO\-wait time. + wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle. + st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown. + +@@ -161,8 +166,6 @@ + total: Total number of available objects + size: Size of each object + pages: Number of pages with at least one active object +-totpages: Total number of allocated pages +-pslab: Number of pages per slab + .fi + + .SH NOTES --- procps-3.2.7.orig/debian/patches/20_sysinfo_c.dpatch +++ procps-3.2.7/debian/patches/20_sysinfo_c.dpatch @@ -0,0 +1,25 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 20_sysinfo_c.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Dont find elf note for non-linux Bug #378157 + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/sysinfo.c procps-3.2.7/proc/sysinfo.c +--- procps-3.2.7~/proc/sysinfo.c 2006-06-25 16:41:48.000000000 +1000 ++++ procps-3.2.7/proc/sysinfo.c 2007-10-04 22:07:48.000000000 +1000 +@@ -218,12 +218,13 @@ + // _SC_NPROCESSORS_ONLN returns 1, which should work OK + smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN); + if(smp_num_cpus<1) smp_num_cpus=1; /* SPARC glibc is buggy */ +- ++#ifdef __linux__ + if(linux_version_code > LINUX_VERSION(2, 4, 0)){ + Hertz = find_elf_note(AT_CLKTCK); + if(Hertz!=NOTE_NOT_FOUND) return; + fputs("2.4+ kernel w/o ELF notes? -- report this\n", stderr); + } ++#endif + old_Hertz_hack(); + } + --- procps-3.2.7.orig/debian/patches/10_uptime.1.dpatch +++ procps-3.2.7/debian/patches/10_uptime.1.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_uptime.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup uptime man page #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/uptime.1 procps-3.2.7/uptime.1 +--- procps-3.2.7~/uptime.1 2006-06-26 09:37:50.000000000 +1000 ++++ procps-3.2.7/uptime.1 2006-06-26 12:45:06.000000000 +1000 +@@ -6,7 +6,8 @@ + .SH SYNOPSIS + .B uptime + .br +-.BR uptime " [" "\-V" ] ++.B uptime ++.RB [ \-V ] + .SH DESCRIPTION + .B uptime + gives a one line display of the following information. +@@ -14,13 +15,25 @@ + how long the system has been running, + how many users are currently logged on, + and the system load averages for the past 1, 5, and 15 minutes. +-.sp ++ + This is the same information contained in the header line displayed by + .BR w (1). ++.sp ++System load averages is the average number of processes that are either ++in a runnable or uninterruptable state. A process in a runnable state is ++either using the CPU or waiting to use the CPU. A process in ++uninterruptable state is waiting for some I/O access, eg waiting for ++disk. The averages are taken over the three time intervals. ++Load averages are not normalized for the number of CPUs in a system, so ++a load average of 1 means a single CPU system is loaded all the time ++while on a 4 CPU system it means it was idle 75% of the time. + .SH FILES +-.IR /var/run/utmp " information about who is currently logged on" +-.br +-.IR /proc " process information" ++.TP ++.I /var/run/utmp ++information about who is currently logged on ++.TP ++.I /proc ++process information + .SH AUTHORS + .B uptime + was written by Larry Greenfield and --- procps-3.2.7.orig/debian/patches/55_pgrep_usage_exitcode.dpatch +++ procps-3.2.7/debian/patches/55_pgrep_usage_exitcode.dpatch @@ -0,0 +1,17 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 55_pgrep_usage_exitcode.dpatch by +## +## DP: Distinguish between invalid commandline parameters and '-?'. + +@DPATCH@ +--- procps-3.2.7.orig/pgrep.c 2007-08-06 16:35:30.000000000 +0200 ++++ procps-3.2.7/pgrep.c 2007-08-06 16:35:06.000000000 +0200 +@@ -678,7 +678,7 @@ + // case 'z': // Solaris: match by zone ID + // break; + case '?': +- usage (opt); ++ usage (optopt?optopt:opt); + break; + } + } --- procps-3.2.7.orig/debian/patches/10_top_irix.dpatch +++ procps-3.2.7/debian/patches/10_top_irix.dpatch @@ -0,0 +1,46 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_top_irix.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Change formal of IRix mode when showing threads #459890 + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2008-04-07 08:43:08.000000000 +1000 ++++ procps-3.2.7/top.c 2008-04-07 08:45:23.000000000 +1000 +@@ -1774,7 +1774,8 @@ + confighlp(Winstk[i].rc.fieldscur); + } + +- if(Rc.mode_irixps && smp_num_cpus>1){ ++ if(Rc.mode_irixps && smp_num_cpus>1 && ++ !(CHKw(Curwin, Show_THREADS))) { + // good for 100 CPUs per process + pcpu_max_value = 9999.0; + Fieldstab[P_CPU].fmts = " %4.0f"; +@@ -2561,6 +2562,15 @@ + case 'H': + if (VIZCHKc) { + TOGw(Curwin, Show_THREADS); ++ if(Rc.mode_irixps && smp_num_cpus>1 && ++ !(CHKw(Curwin, Show_THREADS))){ ++ // good for 100 CPUs per process ++ pcpu_max_value = 9999.0; ++ Fieldstab[P_CPU].fmts = " %4.0f"; ++ } else { ++ pcpu_max_value = 99.9; ++ Fieldstab[P_CPU].fmts = " %#4.1f"; ++ } + show_msg(fmtmk("Show threads %s" + , CHKw(Curwin, Show_THREADS) ? "On" : "Off")); + } +@@ -2617,7 +2627,8 @@ + Rc.mode_irixps = !Rc.mode_irixps; + show_msg(fmtmk("Irix mode %s", Rc.mode_irixps ? "On" : "Off")); + #endif +- if(Rc.mode_irixps && smp_num_cpus>1){ ++ if(Rc.mode_irixps && smp_num_cpus>1 && ++ !(CHKw(Curwin, Show_THREADS))){ + // good for 100 CPUs per process + pcpu_max_value = 9999.0; + Fieldstab[P_CPU].fmts = " %4.0f"; --- procps-3.2.7.orig/debian/patches/40_ps_cgroup_display.dpatch +++ procps-3.2.7/debian/patches/40_ps_cgroup_display.dpatch @@ -0,0 +1,162 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 40_ps_cgroup_display.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: ps displays cgroup #469669 + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/readproc.c procps-3.2.7/proc/readproc.c +--- procps-3.2.7~/proc/readproc.c 2009-01-07 18:20:19.000000000 +1100 ++++ procps-3.2.7/proc/readproc.c 2009-01-07 18:24:51.000000000 +1100 +@@ -598,6 +598,17 @@ + p->environ = file2strvec(path, "environ"); + else + p->environ = NULL; ++ ++ if(linux_version_code>=LINUX_VERSION(2,6,24) && (flags & PROC_FILLCGROUP)) { ++ p->cgroup = file2strvec(path, "cgroup"); /* read /proc/#/cgroup */ ++ if(p->cgroup && *p->cgroup) { ++ int i = strlen(*p->cgroup); ++ if( (*p->cgroup)[i-1]=='\n' ) ++ (*p->cgroup)[i-1] = ' '; //little hack to remove trailing \n ++ } ++ } ++ else ++ p->cgroup = NULL; + + return p; + next_proc: +@@ -686,7 +697,7 @@ + t->cmdline = p->cmdline; // better not free these until done with all threads! + t->environ = p->environ; + #endif +- ++ t->cgroup = p->cgroup; + t->ppid = p->ppid; // ought to put the per-task ppid somewhere + + return t; +@@ -896,6 +907,8 @@ + free((void*)*p->cmdline); + if (p->environ) + free((void*)*p->environ); ++ if (p->cgroup) ++ free((void*)*p->cgroup); + free(p); + } + +diff -urNad procps-3.2.7~/proc/readproc.h procps-3.2.7/proc/readproc.h +--- procps-3.2.7~/proc/readproc.h 2006-06-16 18:01:21.000000000 +1000 ++++ procps-3.2.7/proc/readproc.h 2009-01-07 18:24:56.000000000 +1100 +@@ -139,6 +139,7 @@ + tpgid, // stat terminal process group id + exit_signal, // stat might not be SIGCHLD + processor; // stat current (or most recent?) CPU ++ char **cgroup; // cgroup current cgroup, looks like a classic filepath + } proc_t; + + // PROCTAB: data structure holding the persistent information readproc needs +@@ -239,6 +240,8 @@ + + #define PROC_LOOSE_TASKS 0x0200 // threat threads as if they were processes + ++#define PROC_FILLCGROUP 0x0400 // alloc and fill in `cgroup` ++ + // Obsolete, 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 ) +diff -urNad procps-3.2.7~/ps/display.c procps-3.2.7/ps/display.c +--- procps-3.2.7~/ps/display.c 2005-01-06 10:44:37.000000000 +1100 ++++ procps-3.2.7/ps/display.c 2009-01-07 18:24:32.000000000 +1100 +@@ -223,8 +223,7 @@ + + #define needs_for_format (proc_format_needs|task_format_needs) + +-#define PROC_ONLY_FLAGS (PROC_FILLENV|PROC_FILLARG|PROC_FILLCOM|PROC_FILLMEM) +- ++#define PROC_ONLY_FLAGS (PROC_FILLENV|PROC_FILLARG|PROC_FILLCOM|PROC_FILLMEM|PROC_FILLCGROUP) + /***** munge lists and determine openproc() flags */ + static void lists_and_needs(void){ + check_headers(); +@@ -342,6 +341,7 @@ + } + if(buf.cmdline) free((void*)*buf.cmdline); // ought to reuse + if(buf.environ) free((void*)*buf.environ); // ought to reuse ++ if(buf.cgroup) free((void*)*buf.cgroup); + } + break; + case TF_show_proc|TF_loose_tasks: // H option +@@ -354,6 +354,7 @@ + } + if(buf.cmdline) free((void*)*buf.cmdline); // ought to reuse + if(buf.environ) free((void*)*buf.environ); // ought to reuse ++ if(buf.cgroup) free((void*)*buf.cgroup); + } + break; + case TF_show_proc|TF_show_task: // m and -m options +@@ -366,7 +367,8 @@ + } + if(buf.cmdline) free((void*)*buf.cmdline); // ought to reuse + if(buf.environ) free((void*)*buf.environ); // ought to reuse +- } ++ if(buf.cgroup) free((void*)*buf.cgroup); ++ } + break; + case TF_show_task: // -L and -T options + while(readproc(ptp,&buf)){ +@@ -377,7 +379,8 @@ + } + if(buf.cmdline) free((void*)*buf.cmdline); // ought to reuse + if(buf.environ) free((void*)*buf.environ); // ought to reuse +- } ++ if(buf.cgroup) free((void*)*buf.cgroup); ++ } + break; + } + closeproc(ptp); +diff -urNad procps-3.2.7~/ps/output.c procps-3.2.7/ps/output.c +--- procps-3.2.7~/ps/output.c 2006-06-19 09:27:02.000000000 +1000 ++++ procps-3.2.7/ps/output.c 2009-01-07 18:24:43.000000000 +1100 +@@ -359,6 +359,26 @@ + return max_rightward-rightward; + } + ++static int pr_cgroup(char *restrict const outbuf,const proc_t *restrict const pp) { ++ if(pp->cgroup && *pp->cgroup) { ++ char *endp = outbuf; ++ int rightward=max_rightward; ++ if(forest_prefix){ ++ int fh = forest_helper(outbuf); ++ endp += fh; ++ rightward -= fh; ++ } ++ if(rightward>1){ ++ *endp++ = ' '; ++ rightward--; ++ endp += escape_str(endp, *pp->cgroup, OUTBUF_SIZE, &rightward); ++ } ++ return max_rightward-rightward; ++ } ++ else ++ return pr_nop(outbuf,pp); ++} ++ + /* "ucomm" is the same thing: short unless -f */ + static int pr_comm(char *restrict const outbuf, const proc_t *restrict const pp){ + char *endp = outbuf; +@@ -1248,7 +1268,7 @@ + #define GRP PROC_FILLGRP /* gid_t -> group names */ + #define WCH PROC_FILLWCHAN /* do WCHAN lookup */ + +- ++#define CGRP PROC_FILLCGROUP /* read cgroup */ + /* TODO + * pull out annoying BSD aliases into another table (to macro table?) + * add sorting functions here (to unify names) +@@ -1284,6 +1304,7 @@ + {"bsdtime", "TIME", pr_bsdtime, sr_nop, 6, 0, LNX, ET|RIGHT}, + {"c", "C", pr_c, sr_pcpu, 2, 0, SUN, ET|RIGHT}, + {"caught", "CAUGHT", pr_sigcatch, sr_nop, 9, 0, BSD, TO|SIGNAL}, /*sigcatch*/ ++{"cgroup", "CGROUP", pr_cgroup, sr_nop, 27, CGRP, LNX, PO|UNLIMITED}, + {"class", "CLS", pr_class, sr_sched, 3, 0, XXX, TO|LEFT}, + {"cls", "CLS", pr_class, sr_sched, 3, 0, HPU, TO|RIGHT}, /*says HPUX or RT*/ + {"cmaj_flt", "-", pr_nop, sr_cmaj_flt, 1, 0, LNX, AN|RIGHT}, --- procps-3.2.7.orig/debian/patches/20_top_manpage.dpatch +++ procps-3.2.7/debian/patches/20_top_manpage.dpatch @@ -0,0 +1,438 @@ +#! /bin/sh -e +## 20_top_manpage by Randy Hron +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix bold in top manual page +## DP: Fix page fault description because storage may not be disk +## DP{ Used NE and not ME as a defined as it clashes wirh something + +[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts +patch_opts="${patch_opts:--f --no-backup-if-mismatch}" + +if [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) patch $patch_opts -p1 < $0;; + -unpatch) patch $patch_opts -p1 -R < $0;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argum +ent" + exit 1;; +esac + +exit 0 +@DPATCH@ +diff -urNad procps-3.2.7~/top.1 procps-3.2.7/top.1 +--- procps-3.2.7~/top.1 2009-01-09 17:45:51.000000000 +1100 ++++ procps-3.2.7/top.1 2009-01-09 18:07:32.000000000 +1100 +@@ -42,7 +42,7 @@ + .ds EM \ \fB\-\-\ \fR + \# - these two are for chuckles, makes great grammar + .ds Me top +-.ds ME \fBtop\fR ++.ds NE \fBtop\fR + \# - other misc strings for consistent usage/emphasis + .ds F \fIOff\fR + .ds O \fIOn\fR +@@ -85,7 +85,7 @@ + .\" ---------------------------------------------------------------------- + .SH SYNOPSIS + .\" ---------------------------------------------------------------------- +-\*(ME \-\fBhv\fR | \-\fBbcHisS\fR \-\fBd\fI delay\fR \-\fBn\fI ++\*(NE \-\fBhv\fR | \-\fBbcHisS\fR \-\fBd\fI delay\fR \-\fBn\fI + iterations\fR \-\fBp\fI pid\fR [,\fI pid\fR ...] + + The traditional switches '-' and whitespace are optional. +@@ -94,7 +94,7 @@ + .\" ---------------------------------------------------------------------- + .SH DESCRIPTION + .\" ---------------------------------------------------------------------- +-The \*(ME program provides a dynamic real-time view of a running system. ++The \*(NE program provides a dynamic real-time view of a running system. + It can display\fB system\fR summary information as well as a list of\fB + tasks\fR currently being managed by the Linux kernel. + The types of system summary information shown and the types, order and +@@ -104,7 +104,7 @@ + The program provides a limited interactive interface for process + manipulation as well as a much more extensive interface for personal + configuration \*(EM encompassing every aspect of its operation. +-And while \*(ME is referred to throughout this document, you are free ++And while \*(NE is referred to throughout this document, you are free + to name the program anything you wish. + That new name, possibly an alias, will then be reflected on \*(Me's display + and used when reading and writing a \*(CF. +@@ -190,7 +190,7 @@ + 'I' - Irix mode On\ \ (no, 'solaris' smp) + * 'p' - PID monitoring Off + * 's' - Secure mode Off (unsecured) +- 'B' - Bold disable Off ++ 'B' - Bold enable Off + \fISummary_Area_defaults\fR + 'l' - Load Avg/Uptime On\ \ (thus program name) + 't' - Task/Cpu states On\ \ (1+1 lines, see '1') +@@ -413,16 +413,14 @@ + q:\fB RES\fR \*(EM Resident size (kb) + The non-swapped \*(MP a task has used. + +-RES = CODE + DATA. +- + .TP 3 + r:\fB CODE\fR \*(EM Code size (kb) +-The amount of \*(MP devoted to executable code, also known as ++The amount of \*(MV devoted to executable code, also known as + the 'text resident set' size or TRS. + + .TP 3 + s:\fB DATA\fR \*(EM Data+Stack size (kb) +-The amount of \*(MP devoted to other than executable code, also known as ++The amount of \*(MV devoted to other than executable code, also known as + the 'data resident set' size or DRS. + + .TP 3 +@@ -436,8 +434,8 @@ + The number of\fB major\fR page faults that have occurred for a task. + A page fault occurs when a process attempts to read from or write to a virtual + page that is not currently present in its address space. +-A major page fault is when disk access is involved in making that +-page available. ++A major page fault is when backing storage access (such as a disk) is involved ++in making that page available. + + .TP 3 + v:\fB nDRT\fR \*(EM Dirty Pages count +@@ -504,7 +502,7 @@ + .\" ...................................................................... + .SS 2b. SELECTING and ORDERING Columns + .\" ---------------------------------------------------------------------- +-After pressing the \*(CIs 'f' (Fields select) or \'o' (Order fields) you will ++After pressing the \*(CIs 'f' (Fields select) or 'o' (Order fields) you will + be shown a screen containing the current \fBfields string\fR followed by names + and descriptions for all fields. + +@@ -580,7 +578,7 @@ + see current status, + + .TP 7 +-\ \ \'\fB?\fR\' or \'\fBh\fR\' :\fIHelp\fR ++\ \ \<\fB?\fR\> or \<\fBh\fR\> :\fIHelp\fR + There are two help levels available. + The first will provide a reminder of all the basic \*(CIs. + If \*(Me is\fI secured\fR, that screen will be abbreviated. +@@ -589,7 +587,7 @@ + applicable to \*(AM. + + .TP 7 +-\ \ \'\fB=\fR\' :\fIExit_Task_Limits\fR ++\ \ \<\fB=\fR\> :\fIExit_Task_Limits\fR + Removes restrictions on which tasks are shown. + This command will reverse any 'i' (idle tasks) and 'n' (max tasks) commands + that might be active. +@@ -599,13 +597,13 @@ + When operating in \*(AM this command has a slightly broader meaning. + + .TP 7 +-\ \ \'\fBA\fR\' :\fIAlternate_Display_Mode_toggle\fR ++\ \ \<\fBA\fR\> :\fIAlternate_Display_Mode_toggle\fR + This command will switch between \*(FM and \*(AM. +-\*(XT 4. ALTERNATE\-DISPLAY Mode and the 'G' \*(CI for insight into +-\*(CWs and field groups. ++\*(XT 4. ALTERNATE\-DISPLAY Mode and the 'G' \*(CI for insight ++into \*(CWs and field groups. + + .TP 7 +-\ \ \'\fBB\fR\' :\fIBold_Disable/Enable_toggle\fR ++\ \ \<\fBB\fR\> :\fIBold_Disable/Enable_toggle\fR + This command will influence use of the 'bold' terminfo capability and + alters\fB both\fR the \*(SA and \*(TA for the \*(CW. + While it is intended primarily for use with dumb terminals, it can be +@@ -617,7 +615,7 @@ + there will be no visual confirmation that they are even on. + + .TP 7 +-*\ \'\fBd\fR\' or \'\fBs\fR\' :\fIChange_Delay_Time_interval\fR ++*\ \<\fBd\fR\> or \<\fBs\fR\> :\fIChange_Delay_Time_interval\fR + You will be prompted to enter the delay time, in seconds, between + display updates. + +@@ -631,32 +629,32 @@ + and view the system summary on the second line. + + .TP 7 +-\ \ \'\fBG\fR\' :\fIChoose_Another_Window/Field_Group\fR ++\ \ \<\fBG\fR\> :\fIChoose_Another_Window/Field_Group\fR + You will be prompted to enter a number between 1 and 4 designating the + window/field group which should be made the \*(CW. + You will soon grow comfortable with these 4 windows, especially after + experimenting with \*(AM. + + .TP 7 +-\ \ \'\fBI\fR\' :\fIIrix/Solaris_Mode_toggle\fR ++\ \ \<\fBI\fR\> :\fIIrix/Solaris_Mode_toggle\fR + When operating in 'Solaris mode' ('I' toggled \*F), a task's \*(Pu usage + will be divided by the total number of \*(PUs. + After issuing this command, you'll be informed of the new state of this toggle. + + .TP 7 +-\ \ \'\fBu\fR\' :\fIselect a user\fR ++\ \ \<\fBu\fR\> :\fIselect a user\fR + You will be prompted for a UID or username. Only processes + belonging to the selected user will be displayed. This option + matches on the effective UID. + + .TP 7 +-\ \ \'\fBU\fR\' :\fIselect a user\fR ++\ \ \<\fBU\fR\> :\fIselect a user\fR + You will be prompted for a UID or username. Only processes + belonging to the selected user will be displayed. This option + matches on the real, effective, saved, and filesystem UID. + + .TP 7 +-*\ \'\fBk\fR\' :\fIKill_a_task\fR ++*\ \<\fBk\fR\> :\fIKill_a_task\fR + You will be prompted for a PID and then the signal to send. + The default signal, as reflected in the prompt, is SIGTERM. + However, you can send any signal, via number or name. +@@ -667,24 +665,24 @@ + 2) at the signal prompt, type 0 + + .TP 7 +-\ \ \'\fBq\fR\' :\fIQuit\fR ++\ \ \<\fBq\fR\> :\fIQuit\fR + + .TP 7 +-*\ \'\fBr\fR\' :\fIRenice_a_Task\fR ++*\ \<\fBr\fR\> :\fIRenice_a_Task\fR + You will be prompted for a PID and then the value to nice it to. + Entering a positive value will cause a process to lose priority. + Conversely, a negative value will cause a process to be viewed more + favorably by the kernel. + + .TP 7 +-\ \ \'\fBW\fR\' :\fIWrite_the_Configuration_File\fR ++\ \ \<\fBW\fR\> :\fIWrite_the_Configuration_File\fR + This will save all of your options and toggles plus the current + display mode and delay time. + By issuing this command just before quitting \*(Me, you will be able restart + later in exactly that same state. + + .TP 7 +-\ \ \'\fBZ\fR\' :\fIChange_Color_Mapping ++\ \ \<\fBZ\fR\> :\fIChange_Color_Mapping + This key will take you to a separate screen where you can change the + colors for the \*(CW, or for all windows. + For details regarding this \*(CI \*(Xt 3d. COLOR Mapping. +@@ -700,25 +698,25 @@ + of messages and prompts. + + These commands always impact just the \*(CW/field group. +-\*(XT 4. ALTERNATE\-DISPLAY Mode and the 'G' \*(CI for insight into +-\*(CWs and field groups. ++\*(XT 4. ALTERNATE\-DISPLAY Mode and the 'G' \*(CI for insight ++into \*(CWs and field groups. + + .TP 7 +-\ \ \'\fBl\fR\' :\fIToggle_Load_Average/Uptime\fR \*(EM On/Off ++\ \ \<\fBl\fR\> :\fIToggle_Load_Average/Uptime\fR \*(EM On/Off + This is also the line containing the program name (possibly an alias) when + operating in \*(FM or the \*(CW name when operating in \*(AM. + + .TP 7 +-\ \ \'\fBm\fR\' :\fIToggle_Memory/Swap_Usage\fR \*(EM On/Off ++\ \ \<\fBm\fR\> :\fIToggle_Memory/Swap_Usage\fR \*(EM On/Off + This command affects two \*(SA lines. + + .TP 7 +-\ \ \'\fBt\fR\' :\fIToggle_Task/Cpu_States\fR \*(EM On/Off ++\ \ \<\fBt\fR\> :\fIToggle_Task/Cpu_States\fR \*(EM On/Off + This command affects from 2 to many \*(SA lines, depending on the state + of the '1' toggle and whether or not \*(Me is running under true SMP. + + .TP 7 +-\ \ \'\fB1\fR\' :\fIToggle_Single/Separate_Cpu_States\fR \*(EM On/Off ++\ \ \<\fB1\fR\> :\fIToggle_Single/Separate_Cpu_States\fR \*(EM On/Off + This command affects how the 't' command's Cpu States portion is shown. + Although this toggle exists primarily to serve massively-parallel SMP machines, + it is not restricted to solely SMP environments. +@@ -750,12 +748,12 @@ + .in + + .TP 7 +-\ \ \'\fBb\fR\' :\fIBold/Reverse_toggle\fR ++\ \ \<\fBb\fR\> :\fIBold/Reverse_toggle\fR + This command will impact how the 'x' and 'y' toggles are displayed. + Further, it will only be available when at least one of those toggles is \*O. + + .TP 7 +-\ \ \'\fBx\fR\' :\fIColumn_Highlight_toggle\fR ++\ \ \<\fBx\fR\> :\fIColumn_Highlight_toggle\fR + Changes highlighting for the current sort field. + You probably don't need a constant visual reminder of the sort field and + \*(Me hopes that you always run with 'column highlight' \*F, due to the cost +@@ -765,7 +763,7 @@ + visual reminder. + + .TP 7 +-\ \ \'\fBy\fR\' :\fIRow_Highlight_toggle\fR ++\ \ \<\fBy\fR\> :\fIRow_Highlight_toggle\fR + Changes highlighting for "running" tasks. + For additional insight into this task state, \*(Xt 2a. DESCRIPTIONS of Fields, + Process Status. +@@ -774,7 +772,7 @@ + The only costs will be a few additional tty escape sequences. + + .TP 7 +-\ \ \'\fBz\fR\' :\fIColor/Monochrome_toggle\fR ++\ \ \<\fBz\fR\> :\fIColor/Monochrome_toggle\fR + Switches the \*(CW between your last used color scheme and the older form + of black-on-white or white-on-black. + This command will alter\fB both\fR the \*(SA and \*(TA but does not affect the +@@ -785,20 +783,20 @@ + .B CONTENT\fR of \*(TW + .PD 0 + .TP 7 +-\ \ \'\fBc\fR\' :\fICommand_Line/Program_Name_toggle\fR ++\ \ \<\fBc\fR\> :\fICommand_Line/Program_Name_toggle\fR + This command will be honored whether or not the 'Command' column + is currently visible. + Later, should that field come into view, the change you applied will be seen. + + .TP 7 +-\ \ \'\fBf\fR\' and \'\fBo\fR\' :\fIFields_select\fR or \fIOrder_fields\fR ++\ \ \<\fBf\fR\> and \<\fBo\fR\> :\fIFields_select\fR or \fIOrder_fields\fR + These keys display separate screens where you can change which + fields are displayed and their order. + For additional information on these \*(CIs + \*(Xt 2b. SELECTING and ORDERING Columns. + + .TP 7 +-\ \ \'\fBH\fR\' :\fIThreads_toggle\fR ++\ \ \<\fBS\fR\> :\fICumulative_Time_Mode_toggle\fR + When this toggle is \*O, all individual threads will be displayed. Otherwise, \*(Me displays a summation of all threads in a process. + + .TP 7 +@@ -818,7 +816,7 @@ + effect, simply ask for help and view the window summary on the second line. + + .TP 7 +-\ \ \'\fBu\fR\' :\fIShow_Specific_User_Only\fR ++\ \ \<\fBu\fR\> :\fIShow_Specific_User_Only\fR + You will be prompted to enter the name of the user to display. + Thereafter, in that \*(TW only matching User ID's will be shown, or possibly + no tasks will be shown. +@@ -831,7 +829,7 @@ + .B SIZE\fR of \*(TW + .PD 0 + .TP 7 +-\ \ \'\fBi\fR\' :\fIIdle_Processes_toggle\fR ++\ \ \<\fBi\fR\> :\fIIdle_Processes_toggle\fR + Displays all tasks or just active tasks. + When this toggle is \*F, idled or zombied processes will not be displayed. + +@@ -839,7 +837,7 @@ + affect the window's size, as all prior \*(TDs will have already been painted. + + .TP 7 +-\ \ \'\fBn\fR\' or \'#\' :\fISet_Maximum_Tasks\fR ++\ \ \<\fBn\fR\> or \<\fB#\fR\> :\fISet_Maximum_Tasks\fR + You will be prompted to enter the number of tasks to display. + The lessor of your number and available screen rows will be used. + +@@ -878,12 +876,12 @@ + .in + + .TP 7 +-\ \ \'\fB<\fR\' :\fIMove_Sort_Field_Left\fR ++\ \ \<\fB<\fR\> :\fIMove_Sort_Field_Left\fR + Moves the sort column to the left unless the current sort field is + the first field being displayed. + + .TP 7 +-\ \ \'\fB>\fR\' :\fIMove_Sort_Field_Right\fR ++\ \ \<\fB>\fR\> :\fIMove_Sort_Field_Right\fR + Moves the sort column to the right unless the current sort field is + the last field being displayed. + +@@ -894,7 +892,7 @@ + .in + + .TP 7 +-\ \ \'\fBF\fR\' or \'\fBO\fR\' :\fISelect_Sort_Field\fR ++\ \ \<\fBF\fR\> or \<\fBO\fR\> :\fISelect_Sort_Field\fR + These keys display a separate screen where you can change which field + is used as the sort column. + +@@ -907,7 +905,7 @@ + when running \*(Me with column highlighting turned \*F. + + .TP 7 +-\ \ \'\fBR\fR\' :\fIReverse/Normal_Sort_Field_toggle\fR ++\ \ \<\fBR\fR\> :\fIReverse/Normal_Sort_Field_toggle\fR + Using this \*(CI you can alternate between high-to-low and low-to-high sorts. + + .PP +@@ -984,7 +982,7 @@ + .\" ...................................................................... + .SS 4b. COMMANDS for Windows + .TP 7 +-\ \ \'\fB-\fR\' and \'\fB_\fR\' :\fIShow/Hide_Window(s)_toggles\fR ++\ \ \<\fB-\fR\> and \<\fB_\fR\> :\fIShow/Hide_Window(s)_toggles\fR + The '-' key turns the \*(CW's \*(TD \*O and \*F. + When \*O, that \*(TA will show a minimum of the columns header you've + established with the 'f' and 'o' commands. +@@ -998,7 +996,7 @@ + as the only display element. + + .TP 7 +-*\ \'\fB=\fR\' and \'\fB+\fR\' :\fIEqualize_(re-balance)_Window(s)\fR ++*\ \<\fB=\fR\> and \<\fB+\fR\> :\fIEqualize_(re-balance)_Window(s)\fR + The '=' key forces the \*(CW's \*(TD to be visible. + It also reverses any 'i' (idle tasks) and 'n' (max tasks) commands that might + be active. +@@ -1009,7 +1007,7 @@ + except for the 'i' (idle tasks) and 'n' (max tasks) commands. + + .TP 7 +-*\ \'\fBA\fR\' :\fIAlternate_Display_Mode_toggle\fR ++*\ \<\fBA\fR\> :\fIAlternate_Display_Mode_toggle\fR + This command will switch between \*(FM and \*(AM. + + The first time you issue this command, all four \*(TDs will be shown. +@@ -1017,7 +1015,7 @@ + chosen to make visible. + + .TP 7 +-*\ \'\fBa\fR\' and \'\fBw\fR\' :\fINext_Window_Forward/Backward\fR ++*\ \<\fBa\fR\> and \<\fBw\fR\> :\fINext_Window_Forward/Backward\fR + This will change the \*(CW, which in turn changes the window to which + commands are directed. + These keys act in a circular fashion so you can reach any desired \*(CW +@@ -1028,7 +1026,7 @@ + the \*(TD is \*F and many commands will be restricted. + + .TP 7 +-*\ \'\fBG\fR\' :\fIChoose_Another_Window/Field_Group\fR ++*\ \<\fBG\fR\> :\fIChoose_Another_Window/Field_Group\fR + You will be prompted to enter a number between 1 and 4 designating the + window/field group which should be made the \*(CW. + +@@ -1037,15 +1035,15 @@ + commands. + + .TP 7 +-\ \ \'\fBg\fR\' :\fIChange_Window/Field_Group_Name\fR ++\ \ \<\fBg\fR\> :\fIChange_Window/Field_Group_Name\fR + You will be prompted for a new name to be applied to the \*(CW. + It does not require that the window name be visible + (the 'l' toggle to be \*O). + + .IP "*" 3 + The \*(CIs shown with an \*(AS have use beyond \*(AM. +- \'=', 'A', 'G' are always available +- \'a', 'w' act the same when color mapping ++ '=', 'A', 'G' are always available ++ 'a', 'w' act the same when color mapping + + + .\" ---------------------------------------------------------------------- --- procps-3.2.7.orig/debian/patches/10_skill.1.dpatch +++ procps-3.2.7/debian/patches/10_skill.1.dpatch @@ -0,0 +1,118 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_skill.1.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Cleanup man page #282168 + +@DPATCH@ +diff -urNad procps-3.2.7~/skill.1 procps-3.2.7/skill.1 +--- procps-3.2.7~/skill.1 2008-04-07 11:12:27.000000000 +1000 ++++ procps-3.2.7/skill.1 2008-04-07 11:13:03.000000000 +1000 +@@ -11,37 +11,38 @@ + skill, snice \- send a signal or report process status + + .SH SYNOPSIS +-.nf +-skill [signal to send] [options] process selection criteria +-snice [new priority] [options] process selection criteria +-.fi ++.B skill ++.RI [ "signal to send" ] ++.RI [ options ] ++.I process selection criteria ++.br ++.B snice ++.RI [ "new priority" ] ++.RI [ options ] ++.I process selection criteria + + .SH DESCRIPTION + These tools are probably obsolete and unportable. The command + syntax is poorly defined. Consider using the killall, pkill, + and pgrep commands instead. + +-The default signal for skill is TERM. Use -l or -L to list available signals. ++The default signal for skill is TERM. Use \-l or \-L to list available signals. + Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. +-Alternate signals may be specified in three ways: -9 -SIGKILL -KILL. ++Alternate signals may be specified in three ways: \-9 \-SIGKILL \-KILL. + + The default priority for snice is +4. (snice +4 ...) +-Priority numbers range from +20 (slowest) to -20 (fastest). ++Priority numbers range from +20 (slowest) to \-20 (fastest). + Negative priority numbers are restricted to administrative users. + + .SH "GENERAL OPTIONS" + .TS +-l l l. +--f fast mode This is not currently useful. +--i interactive use T{ +-You will be asked to approve each action. +-T} +--v verbose output T{ +-Display information about selected processes. +-T} +--w warnings enabled This is not currently useful. +--n no action This only displays the process ID. +--V show version Displays version of program. ++lB l l. ++\-f fast mode This is not currently useful. ++\-i interactive use You will be asked to approve each action. ++\-v verbose output Display information about selected processes. ++\-w warnings enabled This is not currently useful. ++\-n no action This only displays the process ID. ++\-V show version Displays version of program. + .TE + + .SH "PROCESS SELECTION OPTIONS" +@@ -49,11 +50,11 @@ + The options below may be used to ensure correct interpretation. + Do not blame Albert for this interesting interface. + .TS +-l l. +--t The next argument is a terminal (tty or pty). +--u The next argument is a username. +--p The next argument is a process ID number. +--c The next argument is a command name. ++lB l. ++\-t The next argument is a terminal (tty or pty). ++\-u The next argument is a username. ++\-p The next argument is a process ID number. ++\-c The next argument is a command name. + .TE + + .SH SIGNALS +@@ -63,7 +64,6 @@ + lB rB lB lB + lfCW r l l. + Name Num Action Description +-.TH + 0 0 n/a exit code indicates if a signal may be sent + ALRM 14 exit + HUP 1 exit +@@ -104,15 +104,20 @@ + lB lB + lfCW l. + Command Description +-.TC + snice seti crack +7 Slow down seti and crack +-skill -KILL -v /dev/pts/* Kill users on new-style PTY devices +-skill -STOP viro lm davem Stop 3 users +-snice -17 root bash Give priority to root's shell ++skill \-KILL \-v /dev/pts/* Kill users on new-style PTY devices ++skill \-STOP viro lm davem Stop 3 users ++snice \-17 root bash Give priority to root's shell + .TE + + .SH "SEE ALSO" +-killall(1) pkill(1) kill(1) renice(1) nice(1) signal(7) kill(2) ++.BR killall (1), ++.BR pkill (1), ++.BR kill (1), ++.BR renice (1), ++.BR nice(1), ++.BR kill(2), ++.BR signal(7) + + .SH STANDARDS + No standards apply. --- procps-3.2.7.orig/debian/patches/30_top.1_cpustate.dpatch +++ procps-3.2.7/debian/patches/30_top.1_cpustate.dpatch @@ -0,0 +1,53 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_top.1_cpustate.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: top CPU state descriptions + +@DPATCH@ +diff -urNad procps-3.2.7~/top.1 procps-3.2.7/top.1 +--- procps-3.2.7~/top.1 2007-10-04 22:35:09.000000000 +1000 ++++ procps-3.2.7/top.1 2007-10-04 22:36:45.000000000 +1000 +@@ -539,6 +539,42 @@ + upper case\fR letter and to the\fB right\fR with the\fB lower case\fR + letter. + ++.\" ...................................................................... ++.SS 2c. CPU States ++.\" ---------------------------------------------------------------------- ++The CPU states are shown in the Summary Area. They are always shown as a ++percentage and are for the time between now and the last refresh. ++ ++.TP 3 ++\fB us\fR \*(EM User CPU time ++The time the CPU has spent running users' processes that are not ++niced. ++ ++.TP 3 ++\fB sy\fR \*(EM System CPU time ++The time the CPU has spent running the kernel and its processes. ++ ++.TP 3 ++\fB ni\fR \*(EM Nice CPU time ++The time the CPU has spent running users' proccess that have been ++niced. ++ ++.TP 3 ++\fB wa\fR \*(EM iowait ++Amount of time the CPU has been waiting for I/O to complete. ++ ++.TP 3 ++\fB hi\fR \*(EM Hardware IRQ ++The amount of time the CPU has been servicing hardware interrupts. ++ ++.TP 3 ++\fB si\fR \*(EM Software Interrupts ++The amount of time the CPU has been servicing software interrupts. ++ ++.TP 3 ++\fB st\fR \*(EM Steal Time ++The amount of CPU 'stolen' from this virtual machine by the hypervisor ++for other tasks (such as running another virtual machine). + + .\" ---------------------------------------------------------------------- + .SH 3. INTERACTIVE Commands --- procps-3.2.7.orig/debian/patches/45_top_exitcode.dpatch +++ procps-3.2.7/debian/patches/45_top_exitcode.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 45_top_exitcode.dpatch by +## +## DP: Make top exit with return code 0 if the program was closed +## DP: cleanly ('q' or end of iteration loop). + +@DPATCH@ +--- procps-3.2.7/top.cO 2007-08-06 15:57:04.000000000 +0200 ++++ procps-3.2.7/top.c 2007-08-06 16:04:07.000000000 +0200 +@@ -402,14 +402,13 @@ + + + /* +- * Normal end of execution. ++ * Normal end of execution. Exit with 1 if signaled, else 0. + * catches: + * SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT and SIGTERM */ +-static void end_pgm (int dont_care_sig) NORETURN; +-static void end_pgm (int dont_care_sig) ++static void end_pgm (int sig) NORETURN; ++static void end_pgm (int sig) + { +- (void)dont_care_sig; +- bye_bye(stdout, 1, NULL); ++ bye_bye(stdout, !!sig, NULL); + } + + --- procps-3.2.7.orig/debian/patches/10_top_stdineof.dpatch +++ procps-3.2.7/debian/patches/10_top_stdineof.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_top_stdineof.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Check for stdin eof if term closes #458986 + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2008-08-10 00:24:40.000000000 +1000 ++++ procps-3.2.7/top.c 2008-08-10 10:09:49.000000000 +1000 +@@ -3382,9 +3382,8 @@ + // check 1st, in case tv zeroed (by sig handler) before it got set + rc = chin(0, &c, 1); + if (rc <= 0) { +- // EOF is pretty much a "can't happen" except for a kernel bug. +- // We should quickly die via SIGHUP, and thus not spin here. +- // if (rc == 0) end_pgm(0); /* EOF from terminal */ ++ if (rc == 0) end_pgm(0); /* EOF from terminal, may happen if top ++ * erroneously gets detached from it. */ + fcntl(STDIN_FILENO, F_SETFL, file_flags); + select(1, &fs, NULL, NULL, &tv); + fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK|file_flags); --- procps-3.2.7.orig/debian/patches/45_vmstat_exitcode.dpatch +++ procps-3.2.7/debian/patches/45_vmstat_exitcode.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 45_vmstat_exitcode.dpatch by +## +## DP: Make vmstat exit with return code of non-zero if there is a problem +@DPATCH@ +diff -ur procps-3.2.7/vmstat.c procps-FIX/vmstat.c +--- procps-3.2.7/vmstat.c 2006-06-24 23:41:48.000000000 -0700 ++++ procps-FIX/vmstat.c 2007-05-21 19:48:47.000000000 -0700 +@@ -290,7 +290,7 @@ + fDiskstat=fopen("/proc/diskstats","rb"); + if(!fDiskstat){ + fprintf(stderr, "Your kernel doesn't support diskstat. (2.5.70 or above required)\n"); +- exit(0); ++ exit(EXIT_FAILURE); + } + + fclose(fDiskstat); +@@ -400,7 +400,7 @@ + } + }else{ + fprintf(stderr, "Your kernel doesn't support diskstat (2.5.70 or above required)\n"); +- exit(0); ++ exit(EXIT_FAILURE); + } + } + --- procps-3.2.7.orig/debian/patches/30_watch_exec_beep.dpatch +++ procps-3.2.7/debian/patches/30_watch_exec_beep.dpatch @@ -0,0 +1,263 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 30_watch_exec_beep.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Adds -exec and -beep flags and has better quoting #410967 +## DP: Adds -errexit flag now too #183346 + +@DPATCH@ +diff -urNad procps-3.2.7~/watch.1 procps-3.2.7/watch.1 +--- procps-3.2.7~/watch.1 2009-01-11 12:11:47.000000000 +1100 ++++ procps-3.2.7/watch.1 2009-01-11 12:18:31.000000000 +1100 +@@ -1,13 +1,16 @@ +-.TH WATCH 1 "1999 Apr 3" " " "Linux User's Manual" ++.TH WATCH 1 "2008 Jan 8" " " "Linux User's Manual" + .SH NAME + watch \- execute a program periodically, showing output fullscreen + .SH SYNOPSIS + .na + .B watch +-.RB [ \-dhvt ] ++.RB [ \-bdehvtx ] + .RB [ \-n + .IR seconds ] ++.RB [ \-\-beep ] + .RB [ \-\-differences[=\fIcumulative\fP]] ++.RB [ \-\-errexit ] ++.RB [ \-\-exec ] + .RB [ \-\-help ] + .RB [ \-\-interval=\fIseconds\fP] + .RB [ \-\-no\-title ] +@@ -17,7 +20,8 @@ + .B watch + runs + .I command +-repeatedly, displaying its output (the first screenfull). This allows you to ++repeatedly, displaying its output and errors (the first screenfull). This ++allows you to + watch the program output change over time. By default, the program is run + every 2 seconds; use + .B \-n +@@ -37,15 +41,33 @@ + or + .B \-\-no\-title + option turns off the header showing the interval, command, and current +-time at the top of the display, as well as the following blank line. ++time at the top of the display, as well as the following blank line. The ++.I \-b ++or ++.I \-\-beep ++option causes the command to beep if it has a non-zero exit. + .PP + .B watch +-will run until interrupted. ++will normally run until interrupted. If you want ++.B watch ++to exit on an error from the program running use the ++.I \-e ++or ++.I \-\-errexit ++options, which will cause ++.B watch ++to exit if the return value from the program is non-zero. ++ + .SH NOTE + Note that + .I command + is given to "sh \-c" + which means that you may need to use extra quoting to get the desired effect. ++You can disable this with the ++.I -x ++or ++.I --exec ++option, which passes the command to exec(2) instead. + .PP + Note that POSIX option processing is used (i.e., option processing stops at + the first non\-option argument). This means that flags after +@@ -93,4 +115,5 @@ + .B watch + was written by Tony Rems in 1991, with mods and + corrections by Francois Pinard. It was reworked and new features added by +-Mike Coleman in 1999. ++Mike Coleman in 1999. The beep, exec, and error handling ++features were added by Morty Abzug in 2008. +diff -urNad procps-3.2.7~/watch.c procps-3.2.7/watch.c +--- procps-3.2.7~/watch.c 2009-01-11 12:11:47.000000000 +1100 ++++ procps-3.2.7/watch.c 2009-01-11 12:21:50.000000000 +1100 +@@ -8,6 +8,7 @@ + * Mike Coleman . + * + * Changes by Albert Cahalan, 2002-2003. ++ * stderr handling, exec, and beep option added by Morty Abzug, 2008 + */ + + #define VERSION "0.2.0" +@@ -35,13 +36,16 @@ + {"differences", optional_argument, 0, 'd'}, + {"help", no_argument, 0, 'h'}, + {"interval", required_argument, 0, 'n'}, ++ {"beep", no_argument, 0, 'b'}, ++ {"errexit", no_argument, 0, 'e'}, ++ {"exec", no_argument, 0, 'x'}, + {"no-title", no_argument, 0, 't'}, + {"version", no_argument, 0, 'v'}, + {0, 0, 0, 0} + }; + + static char usage[] = +- "Usage: %s [-dhntv] [--differences[=cumulative]] [--help] [--interval=] [--no-title] [--version] \n"; ++ "Usage: %s [-bdhntvx] [--beep] [--differences[=cumulative]] [--exec] [--help] [--interval=] [--no-title] [--version] \n"; + + static char *progname; + +@@ -140,28 +144,44 @@ + int optc; + int option_differences = 0, + option_differences_cumulative = 0, ++ option_exec = 0, ++ option_beep = 0, ++ option_errexit = 0, + option_help = 0, option_version = 0; + double interval = 2; + char *command; ++ char **command_argv; + int command_length = 0; /* not including final \0 */ ++ int pipefd[2]; ++ int status; ++ pid_t child; + + setlocale(LC_ALL, ""); + progname = argv[0]; + +- while ((optc = getopt_long(argc, argv, "+d::hn:vt", longopts, (int *) 0)) ++ while ((optc = getopt_long(argc, argv, "+bed::hn:vtx", longopts, (int *) 0)) + != EOF) { + switch (optc) { ++ case 'b': ++ option_beep = 1; ++ break; + case 'd': + option_differences = 1; + if (optarg) + option_differences_cumulative = 1; + break; ++ case 'e': ++ option_errexit = 1; ++ break; + case 'h': + option_help = 1; + break; + case 't': + show_title = 0; + break; ++ case 'x': ++ option_exec = 1; ++ break; + case 'n': + { + char *str; +@@ -191,18 +211,23 @@ + + if (option_help) { + fprintf(stderr, usage, progname); ++ fputs(" -b, --beep\t\t\t\tbeep if the command has a non-zero exit\n", stderr); + fputs(" -d, --differences[=cumulative]\thighlight changes between updates\n", stderr); + fputs("\t\t(cumulative means highlighting is cumulative)\n", stderr); ++ fputs(" -e, --errexit\t\t\t\texit watch if the command has a non-zero exit\n", stderr); + fputs(" -h, --help\t\t\t\tprint a summary of the options\n", stderr); + fputs(" -n, --interval=\t\tseconds to wait between updates\n", stderr); + fputs(" -v, --version\t\t\t\tprint the version number\n", stderr); + fputs(" -t, --no-title\t\t\tturns off showing the header\n", stderr); ++ fputs(" -x, --exec\t\t\t\tpass command to exec instead of sh\n", stderr); + exit(0); + } + + if (optind >= argc) + do_usage(); + ++ command_argv=&(argv[optind]); /* save for later */ ++ + command = strdup(argv[optind++]); + command_length = strlen(command); + for (; optind < argc; optind++) { +@@ -261,11 +286,57 @@ + free(header); + } + +- if (!(p = popen(command, "r"))) { +- perror("popen"); ++ /* allocate pipes */ ++ if (pipe(pipefd)<0) { ++ perror("pipe"); ++ do_exit(7); ++ } ++ ++ /* flush stdout and stderr, since we're about to do fd stuff */ ++ fflush(stdout); ++ fflush(stderr); ++ ++ /* fork to prepare to run command */ ++ child=fork(); ++ ++ if (child<0) { /* fork error */ ++ perror("fork"); + do_exit(2); ++ } else if (child==0) { /* in child */ ++ close (pipefd[0]); /* child doesn't need read side of pipe */ ++ close (1); /* prepare to replace stdout with pipe */ ++ if (dup2 (pipefd[1], 1)<0) { /* replace stdout with write side of pipe */ ++ perror("dup2"); ++ exit(3); ++ } ++ dup2(1, 2); /* stderr should default to stdout */ ++ ++ if (option_exec) { /* pass command to exec instead of system */ ++ if (execvp(command_argv[0], command_argv)==-1) { ++ perror("exec"); ++ exit(4); ++ } ++ } else { ++ status=system(command); /* watch manpage promises sh quoting */ ++ ++ /* propagate command exit status as child exit status */ ++ if (!WIFEXITED(status)) { /* child exits nonzero if command does */ ++ exit(1); ++ } else { ++ exit(WEXITSTATUS(status)); ++ } ++ } ++ ++ } ++ ++ /* otherwise, we're in parent */ ++ close(pipefd[1]); /* close write side of pipe */ ++ if ((p=fdopen(pipefd[0], "r"))==NULL) { ++ perror("fdopen"); ++ do_exit(5); + } + ++ + for (y = show_title; y < height; y++) { + int eolseen = 0, tabpending = 0; + for (x = 0; x < width; x++) { +@@ -313,7 +384,19 @@ + oldeolseen = eolseen; + } + +- pclose(p); ++ fclose(p); ++ ++ /* harvest child process and get status, propagated from command */ ++ if (waitpid(child, &status, 0)<0) { ++ perror("waitpid"); ++ do_exit(8); ++ }; ++ ++ /* if child process exited in error, beep if option_beep is set */ ++ if ((!WIFEXITED(status) || WEXITSTATUS(status))) { ++ if (option_beep) beep(); ++ if (option_errexit) do_exit(8); ++ } + + first_screen = 0; + refresh(); --- procps-3.2.7.orig/debian/patches/55_top_highlight.dpatch +++ procps-3.2.7/debian/patches/55_top_highlight.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 55_top_highlight.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix highlighting problem Closes: #351065 + +@DPATCH@ +diff -urNad procps-3.2.7~/top.c procps-3.2.7/top.c +--- procps-3.2.7~/top.c 2008-01-08 20:13:02.000000000 +1100 ++++ procps-3.2.7/top.c 2008-01-08 20:13:47.000000000 +1100 +@@ -3027,9 +3027,10 @@ + snprintf(_z, sizeof(_z), f, ## va); \ + snprintf(cbuf, sizeof(cbuf), "%s%s%s", \ + q->capclr_rowhigh, \ +- _z, \ ++ _z+advance, \ + !(CHKw(q, Show_HIROWS) && 'R' == p->state) ? q->capclr_rownorm : "" \ + ); \ ++ advance=0; \ + pad += q->len_rowhigh; \ + if (!(CHKw(q, Show_HIROWS) && 'R' == p->state)) pad += q->len_rownorm; \ + } \ --- procps-3.2.7.orig/debian/patches/60_relaxed_100hz_tick_detection.dpatch +++ procps-3.2.7/debian/patches/60_relaxed_100hz_tick_detection.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 60_relaxed_100hz_tick_detection.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Relaxed range detection for 100hz ticks. + +@DPATCH@ +diff -urNad procps-3.2.7~/proc/sysinfo.c procps-3.2.7/proc/sysinfo.c +--- procps-3.2.7~/proc/sysinfo.c 2006-06-25 02:41:48.000000000 -0400 ++++ procps-3.2.7/proc/sysinfo.c 2009-08-05 11:50:17.262112324 -0400 +@@ -150,7 +150,7 @@ + case 48 ... 52 : Hertz = 50; break; + case 58 ... 61 : Hertz = 60; break; + case 62 ... 65 : Hertz = 64; break; /* StrongARM /Shark */ +- case 95 ... 105 : Hertz = 100; break; /* normal Linux */ ++ case 90 ... 105 : Hertz = 100; break; /* normal Linux */ + case 124 ... 132 : Hertz = 128; break; /* MIPS, ARM */ + case 195 ... 204 : Hertz = 200; break; /* normal << 1 */ + case 253 ... 260 : Hertz = 256; break; --- procps-3.2.7.orig/debian/patches/10_sysctl_options.dpatch +++ procps-3.2.7/debian/patches/10_sysctl_options.dpatch @@ -0,0 +1,50 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 10_sysctl_options.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix up some option processing + +@DPATCH@ +diff -urNad procps-3.2.7~/sysctl.c procps-3.2.7/sysctl.c +--- procps-3.2.7~/sysctl.c 2008-08-10 10:57:23.000000000 +1000 ++++ procps-3.2.7/sysctl.c 2008-08-10 10:59:11.000000000 +1000 +@@ -421,6 +421,7 @@ + const char *me = (const char *)basename(argv[0]); + bool SwitchesAllowed = true; + bool WriteMode = false; ++ bool DisplayAllOpt = false; + int ReturnCode = 0; + const char *preloadfile = DEFAULT_PRELOAD; + +@@ -486,8 +487,8 @@ + case 'a': // string and integer values (for Linux, all of them) + case 'A': // same as -a -o + case 'X': // same as -a -x +- SwitchesAllowed = false; +- return DisplayAll(PROC_PATH); ++ DisplayAllOpt = true; ++ break; + case 'V': + fprintf(stdout, "sysctl (%s)\n",procps_version); + exit(0); +@@ -502,6 +503,8 @@ + } else { + if (NameOnly && Quiet) // nonsense + return Usage(me); ++ if (DisplayAllOpt) // We cannot have values with -a ++ return Usage(me); + SwitchesAllowed = false; + if (WriteMode || index(*argv, '=')) + ReturnCode = WriteSetting(*argv); +@@ -509,6 +512,11 @@ + ReturnCode = ReadSetting(*argv); + } + } ++ if (DisplayAllOpt) { ++ if (Quiet) ++ return Usage(me); ++ return DisplayAll(PROC_PATH); ++ } + + return ReturnCode; + } --- procps-3.2.7.orig/debian/patches/50_dev_null_makefile_fix.dpatch +++ procps-3.2.7/debian/patches/50_dev_null_makefile_fix.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## dev_null_makefile_fix.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Make sure Makefile doesnt zot random files while checking GCC + +@DPATCH@ +diff -urNad procps-3.2.6~/Makefile procps-3.2.6/Makefile +--- procps-3.2.6~/Makefile 2005-10-30 07:27:04.000000000 +0100 ++++ procps-3.2.6/Makefile 2005-12-20 02:57:41.000000000 +0100 +@@ -119,7 +119,7 @@ + # Unlike the kernel one, this check_gcc goes all the way to + # producing an executable. There might be a -m64 that works + # until you go looking for a 64-bit curses library. +-check_gcc = $(shell if $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) dummy.c $(ALL_LDFLAGS) $(1) -o /dev/null $(CURSES) > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) ++check_gcc = $(shell if $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) dummy.c $(ALL_LDFLAGS) $(1) -o will_this_file_really_exist.tmp $(CURSES) > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ; rm -f will_this_file_really_exist.tmp) + + # Be 64-bit if at all possible. In a cross-compiling situation, one may + # do "make m64=-m32 lib64=lib" to produce 32-bit executables. DO NOT --- procps-3.2.7.orig/debian/sysctl.d/README +++ procps-3.2.7/debian/sysctl.d/README @@ -0,0 +1,8 @@ +This directory contains settings similar to those found in /etc/sysctl.conf. +In general, files in the 10-*.conf range come from the procps package and +serve as system defaults. Other packages install their files in the +30-*.conf range, to override system defaults. End-users can use 60-*.conf +and above, or use /etc/sysctl.conf directly, which overrides anything in +this directory. + +After making any changes, please run "invoke-rc.d procps start". --- procps-3.2.7.orig/debian/sysctl.d/10-console-messages.conf +++ procps-3.2.7/debian/sysctl.d/10-console-messages.conf @@ -0,0 +1,3 @@ + +# the following stops low-level messages on console +kernel.printk = 4 4 1 7 --- procps-3.2.7.orig/debian/sysctl.d/10-network-security.conf +++ procps-3.2.7/debian/sysctl.d/10-network-security.conf @@ -0,0 +1,12 @@ + +# Turn on Source Address Verification in all interfaces to +# prevent some spoofing attacks. +net.ipv4.conf.default.rp_filter=1 +net.ipv4.conf.all.rp_filter=1 + +# Turn on SYN-flood protections. Starting with 2.6.26, there is no loss +# of TCP functionality/features under normal conditions. When flood +# protections kick in under high unanswered-SYN load, the system +# should remain more stable, with a trade off of some loss of TCP +# functionality/features (e.g. TCP Window scaling). +net.ipv4.tcp_syncookies=1 --- procps-3.2.7.orig/debian/sysctl.d/10-keyboard.conf.powerpc +++ procps-3.2.7/debian/sysctl.d/10-keyboard.conf.powerpc @@ -0,0 +1,6 @@ + +# PowerPC: +# Emulate the middle mouse button with F11 and the right with F12. +dev.mac_hid.mouse_button_emulation = 1 +dev.mac_hid.mouse_button2_keycode = 87 +dev.mac_hid.mouse_button3_keycode = 88