Home | History | Annotate | only in /src/usr.bin/w
History log of /src/usr.bin/w
RevisionDateAuthorComments
 1.23 03-Jun-2023  lukem bsd.own.mk: rename GCC_NO_* to CC_WNO_*

Rename compiler-warning-disable variables from
GCC_NO_warning
to
CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
 1.22 01-Jul-2020  martin Forbid gcc to whine about intended format truncation
 1.21 21-Oct-2011  christos Remove stale proc_compare code and use the shared one in libutil.
 1.20 17-Aug-2011  christos Eliminate non-literal format strings, and now that gcc warns, kill y2k format
warning.
 1.19 26-Feb-2003  christos - Remove SUPPORT_FTPD_UTMP flag. Enable it only for utmp entries, utmpx does
not need it since it can get the pid from the utmpx structure.
- If the line is not found, and the pid is present (from utmpx) use that to
determine the process information for that particular entry.
 1.18 18-Sep-2002  lukem makefile delint. use NETBSDSRCDIR as appropriate
 1.17 27-Jul-2002  christos add utmpx support.
 1.16 28-Sep-2000  jdolecek branches: 1.16.2;
add code to recognize special ftpd utmp entries and match corresponding
process accordingly, so that w parses entries made by "ftpd -U" correctly

the new code is conditionalized upon define SUPPORT_FTPD_UTMP, turned
on by default in w(1)'s Makefile

This addresses bin/11095 by Daniel Hagerty.
 1.15 26-May-2000  simonb branches: 1.15.4;
Use new sysctl/kvm interfaces and remove sgid bit.
 1.14 12-Sep-1999  chs the PMAP_NEW option is gone as the new interface is no longer optional.
 1.13 24-Mar-1999  mrg completely remove Mach VM support. all that is left is the all the
header files as UVM still uses (most of) these.
 1.12 18-Feb-1998  perry add -DPMAP_NEW if PMAP_NEW is on in mk.conf
 1.11 09-Feb-1998  mrg add -DUVM to CPPFLAGS if defined(UVM)
 1.10 08-May-1997  gwr Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
 1.9 06-May-1997  gwr Use .PATH.c: ...
 1.8 07-Jun-1996  thorpej RCS id police.
 1.7 22-Dec-1994  cgd branches: 1.7.6;
specify man pages the new way.
 1.6 09-May-1994  cgd clean up import
 1.5 28-Jan-1994  cgd get rid of getloadavg() linking hack
 1.4 28-Jan-1994  cgd hack to make getloadavg() link properly
 1.3 30-Jul-1993  mycroft Add RCS identifiers.
 1.2 17-Jun-1993  mycroft Don't need -I/sys. (Why was it here?)
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new w, to match libkvm
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.6.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.15.4.1 28-Sep-2000  jdolecek pullup rev. 1.16 from trunk (approved by thorpej):
switch on define SUPPORT_FTPD_UTMP
 1.16.2.1 12-Nov-2002  nathanw Catch up to -current.
 1.3 06-Oct-1994  mycroft Clean up deleted files.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7 21-Oct-2011  christos Remove stale proc_compare code and use the shared one in libutil.
 1.6 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.5 05-Jan-2001  mjl ANSIfy.
 1.4 26-May-2000  simonb Use new sysctl/kvm interfaces and remove sgid bit.
 1.3 07-Jun-1996  thorpej RCS id police.
 1.2 21-May-1995  mycroft branches: 1.2.6;
Gather the argument list only as necessary. Avoid an extra strvisx(3).
Make this compile again with the changes in ps(1).
 1.1 09-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 09-May-1994  cgd new w, to match libkvm
 1.2.6.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.19 17-Apr-2021  maya Remove SCCS workarounds. No binary change.
 1.18 17-Aug-2011  christos Eliminate non-literal format strings, and now that gcc warns, kill y2k format
warning.
 1.17 14-Apr-2009  lukem Fix -Wcast-qual issue
 1.16 08-Jan-2005  kim branches: 1.16.36;
Line up "days" style output in the IDLE field.
 1.15 19-Nov-2004  christos Be a bit more careful with errors; if you cannot find the pty to stat for
time, then report ? instead of the previous random contents of struct stat.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.13 21-Oct-2002  enami Fix whitespace usage.
 1.12 05-Jan-2001  mjl branches: 1.12.2;
ANSIfy.
 1.11 20-Dec-2000  cgd __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that. It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
 1.10 11-Oct-2000  is More format string cleanup by sommerfeld.
 1.9 02-Apr-1998  kleink branches: 1.9.2; 1.9.10;
Need <time.h> for localtime() and strftime() prototypes.
 1.8 20-Oct-1997  lukem minor WARNS for i386
 1.7 20-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.6 13-Apr-1997  mrg properly terminal buffer after calling strftime.
 1.5 14-Nov-1996  mikel preserve data from localtime() buffer before reuse.
PRs bin/2889 and bin/2906, with some improvement by me.
 1.4 27-Sep-1996  thorpej Grok local timezone when determining "today".
From Tatoku Ogaito <tacha@tera.fukui-med.ac.jp>, PR #2534.
 1.3 07-Jun-1996  thorpej RCS id police.
 1.2 21-May-1996  mrg branches: 1.2.2;
print 1day not 1days. pr#2259
 1.1 09-May-1994  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 09-May-1994  cgd new w, to match libkvm
 1.2.2.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.9.10.1 18-Oct-2000  tv Pullup usr.bin string format fixes [is].
See "cvs log" for explicit revision numbers per file, from sommerfeld.
 1.9.2.1 19-Oct-2000  he Pull up revision 1.10 (requested by he):
Format string cleanup.
 1.12.2.1 12-Nov-2002  nathanw Catch up to -current.
 1.16.36.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.15 21-Oct-2011  christos Remove stale proc_compare code and use the shared one in libutil.
 1.14 05-Nov-2007  ad Test p_pctcpu instead of p_estcpu (the latter is specific to SCHED_4BSD).
 1.13 13-Feb-2004  wiz branches: 1.13.24;
Uppercase CPU, plural is CPUs.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.11 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.10 05-Jan-2001  mjl branches: 1.10.2;
ANSIfy.
 1.9 26-May-2000  simonb Use new sysctl/kvm interfaces and remove sgid bit.
 1.8 26-May-2000  thorpej Handle SONPROC state.
 1.7 20-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.6 07-Jun-1996  thorpej RCS id police.
 1.5 09-May-1994  cgd branches: 1.5.8;
clean up import
 1.4 05-May-1994  cgd field name foo
 1.3 05-May-1994  cgd update for changed flags
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new w, to match libkvm
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.8.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.10.2.1 04-May-2002  thorpej Minimal changes needed to build in an LWP'ified universe.
 1.13.24.1 06-Nov-2007  matt sync with HEAD
 1.12 06-Dec-2018  sevan Document the source of load average figures.
 1.11 06-Dec-2018  sevan Add a statement about uptime's relation to w(1).
 1.10 07-Aug-2003  agc branches: 1.10.96; 1.10.98;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.9 01-Dec-2001  wiz branches: 1.9.2;
Whitespace cleanup.
 1.8 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.7 20-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.6 07-Jun-1996  thorpej RCS id police.
 1.5 06-Aug-1994  jtc branches: 1.5.6;
vmunix -> netbsd (PR #375)
 1.4 09-May-1994  cgd branches: 1.4.2;
clean up import
 1.3 01-Aug-1993  mycroft Add RCS indentifiers.
 1.2 13-Jun-1993  mycroft Update file names.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new w, to match libkvm
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.2.1 06-Aug-1994  mycroft update from trunk
 1.5.6.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.9.2.2 01-Dec-2001  wiz Whitespace cleanup.
 1.9.2.1 01-Dec-2001  wiz file uptime.1 was added on branch nathanw_sa on 2001-12-01 16:43:28 +0000
 1.10.98.1 10-Jun-2019  christos Sync with HEAD
 1.10.96.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.20 26-May-2022  mrg default to not sorting tty names with alphabetical sort and add
a new -A switch to sort them again.

enable the sorting code if either utmp or utmpx are enabled,
not just both. shouldn't matter as we enable both.
 1.19 06-Dec-2018  sevan Document the source of load average figures.
 1.18 11-Jan-2005  wiz branches: 1.18.90; 1.18.92;
Bump date for recent changes.
 1.17 08-Jan-2005  kim Make -w flag apply to the WHAT field also (command and args).

Use at most half of ttywidth for WHERE field (hostname) instead
of a hardcoded maximum width. (XXX: this is still not a good
default for displays under 80 columns. Should probably count
the width of all the other columns, using 8 for the WHAT field.)
 1.16 08-Jan-2005  kim The w command does not display a CPU time, so don't talk about it.
 1.15 23-Dec-2004  wiz New sentence, new line. Add a comma.
 1.14 22-Dec-2004  christos PR/28751: Ed Ravin: Limit host field output by default to 35 characters so
that things don't wrap. Add -w flag to enable full output. Delete mention
of the old and not supported flags. This was 11 years ago, and very few
people even remember what these flags did.
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.12 08-Dec-2001  wiz branches: 1.12.2;
Sort SEE ALSO and sections.
 1.11 01-Dec-2001  wiz Whitespace cleanup.
 1.10 19-Oct-2001  wiz Appeared in .Bx 3.0, not .Ux 3.0.
 1.9 22-Mar-1999  garbled More and more .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Many more to
come.
 1.8 01-Nov-1997  mycroft Kill trailing comma in SEE ALSO section.
 1.7 20-Oct-1997  lukem minor WARNS for i386
 1.6 20-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.5 07-Jun-1996  thorpej RCS id police.
 1.4 06-Aug-1994  jtc branches: 1.4.6;
vmunix -> netbsd (PR #375)
 1.3 09-May-1994  cgd branches: 1.3.2;
clean up import
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 09-May-1994  cgd new w, to match libkvm
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.2.1 06-Aug-1994  mycroft update from trunk
 1.4.6.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.12.2.2 08-Dec-2001  wiz Sort SEE ALSO and sections.
 1.12.2.1 08-Dec-2001  wiz file w.1 was added on branch nathanw_sa on 2001-12-08 19:24:11 +0000
 1.18.92.1 10-Jun-2019  christos Sync with HEAD
 1.18.90.1 26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.93 26-May-2022  wiz w: add -A to usage
 1.92 26-May-2022  mrg default to not sorting tty names with alphabetical sort and add
a new -A switch to sort them again.

enable the sorting code if either utmp or utmpx are enabled,
not just both. shouldn't matter as we enable both.
 1.91 17-Apr-2021  maya Remove SCCS workarounds. No binary change.
 1.90 01-Aug-2020  kim Skip bracket processing if -n is used.

XXX: This could be improved to skip even more processing.
 1.89 01-Aug-2020  kim Restore ']' if not using a result from an address lookup.
 1.88 01-Aug-2020  kim Handle hostname from DISPLAY="[2001:db8::dead:beef]:0" or similar.
 1.87 04-Jul-2020  kim Don't overwrite host_buf as x might be pointing to wanted data in it
 1.86 30-Jun-2020  kim Remove local domain always, not just when looking up addresses
 1.85 30-Jun-2020  kim Compute a value for domain before comparing against it
 1.84 30-Oct-2018  kre branches: 1.84.2;

sysctl(KERN_BOPOTIME) started returning a struct timespec in 2009.
Update to match.... We're slow but we get there eventually!

NFC for any of these programs, struct timeval and struct timespec
are the same size, and only the tv_sec field of boottime is used,
and that's unchanged.
 1.83 16-Nov-2016  christos branches: 1.83.6; 1.83.12; 1.83.14;
if there is more than one : it is not an X display, it is a v6 address
 1.82 22-Dec-2014  dennis branches: 1.82.2;
Move enough additional 'w' code into 'uptime' to keep the latter
from double-counting utmp users.
 1.81 03-Dec-2014  mrg redo the previous; avoid a bunch of processing when running as "uptime",
and as a side effect, avoid any name lookups.
 1.80 02-Dec-2014  christos if doing uptime, don't bother resolving names.
 1.79 27-Feb-2014  joerg struct member can't be null, if the pointer itself is valid.
 1.78 19-Feb-2014  dsl Remove some pointless inclusions os sys/user.h
 1.77 09-Sep-2013  christos Expand ep->host to contain the final string that we are going to print
before computing the width of the host column.
 1.76 21-Oct-2011  christos branches: 1.76.2; 1.76.8;
Remove stale proc_compare code and use the shared one in libutil.
 1.75 16-Sep-2011  joerg Use __dead
 1.74 14-Apr-2009  lukem Fix WARNS=4 issues
 1.73 21-Jul-2008  lukem branches: 1.73.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.72 22-Jun-2006  christos branches: 1.72.20;
Use the UTX sizes + 1 for the struct to save space.
Don't complain if pid == 0
 1.71 15-Sep-2005  rpaulo Don't print a warning about stale utmp{,x} entries if security.curtain
sysctl is equal to 1. We can still detect stale utmp entries if that
knob is off.
 1.70 04-Sep-2005  elad Revert previous commit. I forgot we already do that. :)
 1.69 04-Sep-2005  elad Use sysctl to fetch process information if reading live kernel.
 1.68 13-Mar-2005  kim One third of screen looks much better than half, for default maxhost.
 1.67 08-Jan-2005  kim Make -w flag apply to the WHAT field also (command and args).

Use at most half of ttywidth for WHERE field (hostname) instead
of a hardcoded maximum width. (XXX: this is still not a good
default for displays under 80 columns. Should probably count
the width of all the other columns, using 8 for the WHAT field.)
 1.66 22-Dec-2004  christos Fix usage, and call setprogname()!
 1.65 22-Dec-2004  christos PR/28751: Ed Ravin: Limit host field output by default to 35 characters so
that things don't wrap. Add -w flag to enable full output. Delete mention
of the old and not supported flags. This was 11 years ago, and very few
people even remember what these flags did.
 1.64 19-Nov-2004  christos Be a bit more careful with errors; if you cannot find the pty to stat for
time, then report ? instead of the previous random contents of struct stat.
 1.63 11-Nov-2004  christos PR/28185: Brian Marcotte: w command broken when user specified
 1.62 10-Nov-2004  christos Don't print just two characters for the tty; change the field width of the
tty to 7.
 1.61 03-Jan-2004  wiz Remove superfluous max() macro.
Noted by Jeff Ito in PR 23932.
 1.60 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.59 12-Jul-2003  itojun strlcpy
 1.58 26-Feb-2003  christos keep track of the two proc entries significant to the utmp entry. The one
indicated by the pid in struct utmpx [or ftpd hack], and the one that is
associated with the controlling tty, is in the foreground process group,
and has most cpu. If the second one exists, use that one, else use the first
one.
 1.57 26-Feb-2003  fredb Print the command in parenthesis, if kvm_getargv2() returns no
arguments. This lets "xterm -e command" display as "(command)".
Reviewed by christos.
 1.56 26-Feb-2003  christos keep track which entries are utmp and which are utmpx, so we can print
them on the stale message.
 1.55 26-Feb-2003  christos - Remove SUPPORT_FTPD_UTMP flag. Enable it only for utmp entries, utmpx does
not need it since it can get the pid from the utmpx structure.
- If the line is not found, and the pid is present (from utmpx) use that to
determine the process information for that particular entry.
 1.54 21-Oct-2002  enami Fix whitespace usage.
 1.53 21-Oct-2002  enami If utmpx support is enabled, use sockaddr field to get numeric address.
 1.52 16-Sep-2002  christos Make uptime show the correct number of users.
 1.51 16-Sep-2002  mycroft uptime(1) is NOT supposed to always say `1 user'.
 1.50 22-Aug-2002  christos fixed user miscounting. reported by kim.
 1.49 28-Jul-2002  christos skip blank entries.
 1.48 27-Jul-2002  christos add utmpx support.
 1.47 05-Nov-2001  enami branches: 1.47.2;
Fix whitespace usage.
 1.46 19-Feb-2001  cgd convert to use getprogname()
 1.45 05-Jan-2001  mjl ANSIfy.
 1.44 05-Jan-2001  mjl (From FreeBSD)
Get things right for tty names of length UT_LINESIZE. (FreeBSD PR 3638)
If the utmp login time is greater than the tty atime, use it to calculate
the idle time instead of the atime.
Fix -n with 16-chars hostnames (FreeBSD PR 11286).
Domain names are case insensitive.
 1.43 20-Dec-2000  cgd __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that. It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
 1.42 28-Sep-2000  jdolecek add code to recognize special ftpd utmp entries and match corresponding
process accordingly, so that w parses entries made by "ftpd -U" correctly

the new code is conditionalized upon define SUPPORT_FTPD_UTMP, turned
on by default in w(1)'s Makefile

This addresses bin/11095 by Daniel Hagerty.
 1.41 21-Aug-2000  christos - Don't core dump when we have stale utmp entries; warn the user instead.
- Make this work again in single user when invoked as uptime and utmp is
not present.
 1.40 22-Jul-2000  simonb Redo previous slightly differently - restore the behaviour of two
characters for the tty name and the first 'T' of 'TTY' hanging over
the blank column at the end of the username field.
 1.39 15-Jul-2000  enami - Set the minimum width for login name to 4, the width of "USER".
- Fix the number of colmuns left for proc. args. Previously, an effect of
NUL was canceled implicitly, but now we must handle it explicitly.
- Fix the width for tty name.
 1.38 13-Jul-2000  simonb Use KERN_CONSDEV for determining the console device instead of CPU_CONSDEV
which is not available on all ports.
 1.37 25-Jun-2000  simonb Use p_login from struct proc instead of ut_name from struct utmp so
that a truncated name isn't used if the login name is over 8 characters
long. Size USER field to suit.

Fixes PR bin/2459 from Neil McRae.
 1.36 08-Jun-2000  enami branches: 1.36.2;
Pass the size of struct kinfo_proc2 instead of kinfo_proc to kvm_getproc2
so that w(1) displays what commands are running as before.
 1.35 26-May-2000  simonb branches: 1.35.2;
Use new sysctl/kvm interfaces and remove sgid bit.
 1.34 29-Nov-1999  pk No need for <machine/cpu.h> here.
 1.33 09-Nov-1999  drochner Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
 1.32 11-Oct-1999  mrg recognise "dty" the same as we do "tty"
 1.31 29-Jan-1999  pk branches: 1.31.2; 1.31.4;
Use correct buffer in kvm_openfiles().
 1.30 06-Jul-1998  mrg - change setgid kmem programs (that lend themselves to this) so setegid(getgid())
and the top, and then set the effective gid back to kmem around the call to
kvm_openfiles(). this reduces the time group kmem is available.
- for those above that also allow this, setgid(getgid()) after the call to
kvm_openfiles() to fully revoke priviledges.
- some KNF
- use err(3) over fprintf(3) in some places
 1.29 06-Jul-1998  mrg - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
 1.28 02-Apr-1998  kleink Need <time.h> for strftime() and related definitions. Also, no need to
include <sys/tty.h>.
 1.27 20-Oct-1997  lukem minor WARNS for i386
 1.26 20-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.25 07-Jul-1997  phil Don't print "up" if uptime is less than 30 seconds. (uptime rounds
to the nearest minute.) Closes PR 2082.
 1.24 19-May-1997  mycroft Use inet_aton(3) rather than inet_addr(3).
 1.23 13-Apr-1997  mrg properly terminal buffer after calling strftime.
 1.22 31-Mar-1997  christos PR/3416: enami tsugutomo: fix bug introduced in previous change to handle
long hostnames.
 1.21 29-Mar-1997  christos PR/3399: Tatoku Ogaito: Careful with not null terminated utmp strings.
 1.20 03-Mar-1997  explorer Message buffer passed to kvm_openfiles() should _POSIX2_LINE_MAX long; PR#3266
 1.19 09-Jan-1997  tls Sync to 4.4BSD-Lite2
 1.18 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel as suggested
by Mike Grupenhoff <ashmir@umiacs.umd.edu> in PR #2485.
 1.17 08-Apr-1996  jtc branches: 1.17.4;
Use errx() instead of err() to report failure of kvm_getprocs() call,
as errno doesn't have a meaningful value in this case. Reported by
Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2289.
 1.16 25-May-1995  mycroft Don't core dump when tty has no associated process.
 1.15 21-May-1995  mycroft Gather the argument list only as necessary. Avoid an extra strvisx(3).
Make this compile again with the changes in ps(1).
 1.14 28-Mar-1995  cgd fix annoying number consistency bug.
 1.13 30-Jun-1994  cgd Fix from John Brezak for the following bug:
If there is a non-tty entry in utmp, w(1) will exit with an error.
However there are legitimate non-tty entries, for instance an xlogin via
xdm can be identified with the xlogin program. In this case there is an
entry with the display name as the ut_tty.
 1.12 30-Jun-1994  cgd fix from Jarle Greipsland <jarle@idt.unit.no> to deal with ut_line misprinting.
 1.11 09-May-1994  cgd clean up import
 1.10 05-May-1994  cgd update for changed flags
 1.9 26-Oct-1993  mycroft Print `-' rather than ` ' for 0 idle time.
 1.8 01-Aug-1993  mycroft Add RCS identifiers.
 1.7 15-Jul-1993  cgd don't print process args, print the vis(3)'d process args...
 1.6 07-Jul-1993  deraadt chris found a case where cn_tty was being used. Doesn't look like the
right thing to do, so it goes away.
 1.5 08-Jun-1993  mycroft Fix definition of rcsid.
 1.4 20-May-1993  cgd add rcsid
 1.3 26-Apr-1993  mycroft Don't segv if no process found on tty.
 1.2 12-Apr-1993  sef Print spaces instead of '0' for a non-idle user. Looks nicer.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3 09-Jan-1997  tls Import from 4.4BSD-Lite2
 1.1.1.2 09-May-1994  cgd new w, to match libkvm
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17.4.1 07-Jun-1996  thorpej Discard setgid privileges if not reading the running kernel, as suggested
by Mike Grupenhoff <kashmir@umiacs.umd.edu> in PR #2485.

Also, RCS id police.
 1.31.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.31.2.1 12-Oct-1999  he Pull up revision 1.32 (requested by mrg):
Fix "dty" vs "tty" problems that have existed since "dty"s were
invented sometime before 1.4 was released.
 1.35.2.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.36.2.4 28-Sep-2000  jdolecek pullup rev. 1.42 from trunk (approved by thorpej):
add code to recognize special ftpd utmp entries and match corresponding
process accordingly, so that w parses entries made by "ftpd -U" correctly
the new code is conditionalized upon define SUPPORT_FTPD_UTMP

This addresses bin/11095 by Daniel Hagerty.
 1.36.2.3 28-Sep-2000  simonb Pull up rev 1.41 by christos (approved by thorpej):
- Don't core dump when we have stale utmp entries; warn the user instead.
- Make this work again in single user when invoked as uptime and utmp is
not present.
 1.36.2.2 22-Jul-2000  simonb Pull up revs 1.38-1.40:
Summary of changes are:
+ Use KERN_CONSDEV for determining the console device.
+ Set minimum width for login name properly.
 1.36.2.1 26-Jun-2000  simonb Pull up rev 1.37:
Use p_login from struct proc instead of ut_name from struct utmp so
that a truncated name isn't used if the login name is over 8 characters
long. Size USER field to suit.

Fixes PR bin/2459 from Neil McRae.
 1.47.2.2 12-Nov-2002  nathanw Catch up to -current.
 1.47.2.1 05-Nov-2001  nathanw file w.c was added on branch nathanw_sa on 2002-11-12 20:32:03 +0000
 1.72.20.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.73.6.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.76.8.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.76.2.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.82.2.1 07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.83.14.1 10-Jun-2019  christos Sync with HEAD
 1.83.12.1 26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.83.6.3 02-Aug-2020  martin Pull up following revision(s) (requested by kim in ticket #1583):

usr.bin/w/w.c: revision 1.88
usr.bin/w/w.c: revision 1.89
usr.bin/w/w.c: revision 1.90

Handle hostname from DISPLAY="[2001:db8::dead:beef]:0" or similar.

Restore ']' if not using a result from an address lookup.

Skip bracket processing if -n is used.
XXX: This could be improved to skip even more processing.
 1.83.6.2 07-Jul-2020  martin Pull up following revision(s) (requested by kim in ticket #1565):

usr.bin/w/w.c: revision 1.87

Don't overwrite host_buf as x might be pointing to wanted data in it
 1.83.6.1 30-Jun-2020  martin Pull up following revision(s) (requested by kim in ticket #1564):

usr.bin/w/w.c: revision 1.86
usr.bin/w/w.c: revision 1.85

Compute a value for domain before comparing against it
Remove local domain always, not just when looking up addresses
 1.84.2.3 02-Aug-2020  martin Pull up following revision(s) (requested by kim in ticket #1034):

usr.bin/w/w.c: revision 1.88
usr.bin/w/w.c: revision 1.89
usr.bin/w/w.c: revision 1.90

Handle hostname from DISPLAY="[2001:db8::dead:beef]:0" or similar.

Restore ']' if not using a result from an address lookup.

Skip bracket processing if -n is used.
XXX: This could be improved to skip even more processing.
 1.84.2.2 07-Jul-2020  martin Pull up following revision(s) (requested by kim in ticket #982):

usr.bin/w/w.c: revision 1.87

Don't overwrite host_buf as x might be pointing to wanted data in it
 1.84.2.1 30-Jun-2020  martin Pull up following revision(s) (requested by kim in ticket #979):

usr.bin/w/w.c: revision 1.86
usr.bin/w/w.c: revision 1.85

Compute a value for domain before comparing against it
Remove local domain always, not just when looking up addresses

RSS XML Feed