Home | History | Annotate | Download | only in ps
History log of /src/bin/ps/extern.h
RevisionDateAuthorComments
 1.39  09-Dec-2017  kamil branches: 1.39.4;
ps: Rename local routine name from uname to usrname

This removes symbol name routine clash with libc's uname(3).
This allows to build ps(1) against LLVM Sanitizers.

Sponsored by <The NetBSD Foundation>
 1.38  02-Dec-2016  christos provide a tree like display with -d, from FreeBSD
 1.37  28-Nov-2016  rin Calculate CPU usage (pcpu) once per process if it is required. This change
significantly improves performance for slow machines when output is sorted
by pcpu.

ok martin
 1.36  28-Nov-2016  rin for donlist{,_sysctl}:
- obtain log_ccpu = log(ccpu) rather than ccpu itself
- use common default values and warn users appropriately when errors occur
ok martin
 1.35  20-Apr-2014  dholland branches: 1.35.6;
Use an enum type for PRINTMODE vs. WIDTHMODE. Compiler output diffs have
been checked.
 1.34  15-Jan-2014  mlelstv branches: 1.34.2;
Add an LTIME column that prints lwp cputime.
 1.33  31-May-2010  rmind branches: 1.33.6; 1.33.12;
Fix ps(1) and top(1) to show reasonable CPU numbers i.e. cpu_index() provided
by the kernel, instead of CPU order number, which is generally random.
 1.32  10-Feb-2008  christos Add a CPUID keyword; idea and some of the code from Anon Ymous
 1.31  01-Sep-2007  yamt add a keyword "lname", to print l_name.
 1.30  29-Oct-2006  christos branches: 1.30.8;
Add support for printing the emulation of the process.
 1.29  02-Oct-2006  apb * When all columns are given null customised headers, the blank header
line is not printed at all. This is specified in P1003.1-2004
(SUSv3), and is useful.

* Customised headers may contain embedded space, commas and equals
signs. To specify multiple customised headers, use multiple -o or -O
options. This is specified (for "-o", not for "-O") in P1003.1-2004
(SUSv3), and is useful.

* When a column is given a null (blank) customised header, it keeps its
default minimum width. This is specified in P1003.1-2004 (SUSv3), and
seems harmless.

* Fix a bug that made it impossible to print the same keyword multiple
times, with different customised headers each time. (Previously, the
last customised header was used for all instances of the keyword.)

* Make the behaviour of "-O" more useful. The first -O option adds
the default keywords only if there have not yet been any formatting
options, and multiple -O options now insert their keywords in adjacent
positions. Now {ps -j -O %cpu} is like {ps -j} with one extra column;
Previously, it would have had all the columns implied by "-j", plus
all the default columns, plus the extra column specified by "-O".

* Convert from home-grown linked lists to SIMPLEQ lists.

Discussed in tech-userlevel.
 1.28  26-Jun-2005  christos sprinkle a little const, and now everything compiles with WARNS=3
 1.27  27-Mar-2004  simonb Add support for the POSIX.2 "etime" keyword - shows the elapsed time
since the process was started. Fix a couple of style nits as well.

Fix for part of PR standards/11224.
 1.26  27-Mar-2004  simonb KNF, ANSFify, de-__P, unC++ify, white space nits.
 1.25  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.
 1.24  06-Mar-2003  dsl - add keywords for utime, stime and ctime (output sss.ssssss if small)
- fiddle with keyword table - mainly to keep width under 80 cols
- add -k keylist so sort output
- don't use logs to work out field width, get -MAXINT right
- user defined headers can be 1 char (actually they can be zero length)
so ?? in tty column isn't guaranteed to be wider than header
- remove some long long casts (compiles on sparc64 still)
- use kvm_openfiles(NULL, NULL, NULL, KVN_NO_FILES, ..) unless core file
specified,
(approved by christos)
 1.23  01-Mar-2003  atatat Add p_svuid and p_svgid to kinfo_proc2. Populate them in the kernel
and in libkvm. Then teach ps how to show them to you.

Also, teach ps how to show the names for all the uids, the rest of the
group numbers, and the "group access list".
 1.22  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.21  19-Jun-2002  jdolecek g/c procfs fallback code, it's redundant now that we use sysctl to get
process info
 1.20  14-Jul-2001  matt branches: 1.20.2;
Retrieve maxslp & uspace from kernel instead of using defines. Needed for
shared arm code.
 1.19  07-Jun-2000  simonb Calculate field widths on the fly so that all columns line up nicely
and make more effective use of screen real estate when some columns
(eg USER and VSZ) didn't need the full default width.
 1.18  02-Jun-2000  simonb G/C evar() - now that everything is in the one structure it was exactly
the same as pvar().
 1.17  26-May-2000  simonb branches: 1.17.2;
Use new sysctl/kvm interfaces. This will stop the "proc size mismatch"
errors when internal kernel structures change size. Also remove
the sgid bit - all live kernel data is accessed through the sysctl
interface.
 1.16  03-Dec-1999  simonb Since we have an "extern.h", put all external variable declarations in
that file and not sprinkled around various .c files.
 1.15  03-Dec-1999  simonb "ps -e" only shows the environment for the processes owned by the
current user id or all process if run by root.

Fixes PR security/5967 from Todd Vierling.
 1.14  15-Oct-1999  jdolecek When using the procfs for extracting process information, extract
also process start time, process arguments and session leadership status.

The procfs fallback is also used when kvm_openfiles() completely fails
(e.g. when /dev/mem is not readable).

Solves PR 7772, though the final implementation is different.
 1.13  26-Mar-1999  bgrayson branches: 1.13.2; 1.13.4;
Added experimental fallback /proc-based lookup. Warnings are printed when the
fallback method is used, as the results could be untrustworthy if an
intruder is present. It is highly likely that NetBSD-1.5 will have
an improved kvm interface for reading process information, at which
point this code can be garbage-collected. Also added a word to the
man page -x option description while I was here.
 1.12  06-Feb-1998  mrg remove old OLD BSD VM code.
 1.11  02-Oct-1996  ws Fix p_nice vs. NZERO code.
Remove some unnecessary casts.
Remove an unused time format field.
 1.10  21-May-1995  mycroft Split out some helper functions again.
 1.9  18-May-1995  mycroft Create and strvis(3) the argument and environment lists only as needed.
Do not keep extra copies around.
 1.8  21-Mar-1995  cgd convert to new RCS id conventions.
 1.7  03-Jul-1994  deraadt devname is in libc now
 1.6  16-Jun-1994  pk Declare devname().
 1.5  09-May-1994  cgd clean up import
 1.4  01-Aug-1993  mycroft Add RCS identifiers.
 1.3  23-Mar-1993  cgd changed "Id" to "Header" for rcsids
 1.2  22-Mar-1993  cgd added rcs ids to all files
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  09-May-1994  cgd new ps, to match libkvm
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13.4.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.13.2.1  08-Nov-1999  cgd pull up rev 1.14 from trunk (requested by jdolecek):
When using the procfs for extracting process information, extract process
start time, arguments, and session leadership status. Also, fall back to
procfs when kvm_openfiles() completely fails (e.g. when /dev/mem is not
readable). Fixes PR#7772.
 1.17.2.1  22-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.20.2.3  24-Apr-2002  nathanw Note the presense of multiple LWPs or scheduler activations under "state".
Add a "lstate" that prints LWP-specific state and display it instead
of "state" under ps -s.
 1.20.2.2  23-Apr-2002  nathanw Add support for handling multi-LWP processes by selecting one LWP as
"representative" of the process.
Also add a -s option that prints a line for each LWP.
While I'm here, remove the /proc fallback code.
 1.20.2.1  14-Jul-2001  nathanw file extern.h was added on branch nathanw_sa on 2002-04-23 20:41:12 +0000
 1.30.8.2  23-Mar-2008  matt sync with HEAD
 1.30.8.1  06-Nov-2007  matt sync with HEAD
 1.33.12.1  19-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.33.6.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.34.2.1  10-Aug-2014  tls Rebase.
 1.35.6.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.39.4.2  21-Apr-2020  martin Ooops, restore accidently removed files from merge mishap
 1.39.4.1  21-Apr-2020  martin Sync with HEAD

RSS XML Feed