History log of /freebsd-10.0-release/usr.bin/w/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


253750 28-Jul-2013 avg

Revert r253748,253749

This WIP should not have been committed yet.

Pointyhat to: avg


253749 28-Jul-2013 avg

remove needless inclusion of machine/cpu.h in userland

MFC after: 21 days


245635 19-Jan-2013 jhb

- Move 'showthreads' check out of fmt.c.
- Update shadow copy of fmt_argv() prototype in w.c and fix calls for
additional parameter.


245633 18-Jan-2013 delphij

Set showthread = 0 for w(1).

X-MFC: together with r245610


243183 17-Nov-2012 ed

Fix whitespace.

MFC after: 1 week


241484 12-Oct-2012 emaste

Use CLOCK_UPTIME to get the uptime.


240506 14-Sep-2012 eadler

Bump date missed in r202756

PR: docs/171624
Submitted by: bdrewery
Approved by: gabor
MFC after: 3 days


227199 06-Nov-2011 ed

Add missing static keywords to w(1)


223786 05-Jul-2011 ed

Only print entries for which ut_host points to a character device.

Now that we use utmpx, we more often have entries for which the ut_line
is left blank. To prevent us from returning struct stat for "/dev/",
check that the resulting stat structure belongs to a character device.


216370 11-Dec-2010 joel

Remove the advertising clause from UCB copyrighted files in usr.bin. This
is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change

Also add $FreeBSD$ to a few files to keep svn happy.

Discussed with: imp, rwatson


203688 08-Feb-2010 brucec

Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N.

PR: bin/138146
Approved by: rrs (mentor)
MFC after: 3 days


202756 21-Jan-2010 ed

Remove stale references to utmp(5) and its corresponding filenames.

I removed utmp and its manpage, but not other manpages referring to it.


202199 13-Jan-2010 ed

Port w(1) to utmpx.

Let it print "-" when the TTY string is empty. In this case, it must
also make sure it doesn't match processes who also have no controlling
TTY. Otherwise it will print random kernel processes when trying to pick
the best matching process.

Eventually it should look at the value of ut_pid as well.


201727 07-Jan-2010 dwmalone

This now passes a make universe with WARNS=6.


201611 05-Jan-2010 dwmalone

Shuffle parens to avoid type-punning warning.


201386 02-Jan-2010 ed

Build usr.bin/ with WARNS=6 by default.

Also add some missing $FreeBSD$ to keep svn happy.


200462 13-Dec-2009 delphij

Revert most part of 200420 as requested, as more review and polish is
needed.


200420 11-Dec-2009 delphij

Remove unneeded header includes from usr.bin/ except contributed code.

Tested with: make universe


200172 06-Dec-2009 ed

Let w(1) use utmpx.

We don't have UT_*SIZE anymore. One of the reasons for that is because
all strings are null terminated, there is no need for apps to copy
strings out of the utmpx structure. This means we can define W_DISP*SIZE
lengths for all columns.

While there, adjust the sizes a little. Steal some bytes from the
username column, while extending the hostname column quite a bit.


199655 22-Nov-2009 ume

When -n is specified, attempt to turn hostnames found in utmp into IP
addresses, again. However, change a hostname into an IP address, only
when a host has just one A/AAAA RR.

Requested by: candy__at__kgc.co.jp
MFC after: 2 weeks


196956 08-Sep-2009 delphij

Constify format string pointer, otherwise this would trigger warning when
higher warning level is enabled.


196652 30-Aug-2009 ume

Fix the problem that the entry broke into two lines with multi-byte
AM/PM format.

Reported by: takawata


181922 20-Aug-2008 ache

w(1) uses strftime %b with to print the abbreviated month name
if a user logged in more than a week ago.
This may contain multibyte characters (e.g. when using UTF-8).
This string is then aligned on byte-length rathern than char-length,
resulting in misalignment and unfinished multibyte characters.

PR: 126657
Submitted by: Johan van Selst <johans@stack.nl>


165226 14-Dec-2006 ru

Fix markup.


158444 11-May-2006 phk

Use sysctlbyname


151417 17-Oct-2005 andre

Obtain true uptime through clock_gettime(CLOCK_MONOTONIC, struct *timespec)
instead of subtracting 'bootime' from 'now'.

Sponsored by: TCP/IP Optimization Fundraise 2005


146983 04-Jun-2005 gad

Use the ki_udata field that was recently-added to kinfo_proc, instead of
stealing ki_spare[0] to hold a pointer.


141846 13-Feb-2005 ru

Expand *n't contractions.


140420 18-Jan-2005 ru

Sort sections.


128231 14-Apr-2004 bde

Include <sys/proc.h> instead of depending on namespace pollution in
<sys/user.h> for the definition of TDF_SINTR. Fixed anachronous
spelling of TDF_SINTR in a comment

Demangled VCS ids. There were 2 misplaced copies of $FreeBSD$ and of
the include before it. The vendor id infrastructure was edited.

Fixed the only other remaining style bug since rev.1.1 (expansion of
struct member names made a line too long).


119854 07-Sep-2003 charnier

Do not print the result of strftime() in case of failure, the content is
indeterminate in such a case. The correct value for 2nd argument is
sizeof(buf). Do not NUL-terminate the result string, strftime() will do it
for us.


116998 28-Jun-2003 peter

utmp.ut_time is not a time_t, do not pass a pointer to it to pr_attime().


102300 23-Aug-2002 seanc

Fix warning when calling w(1) when logged in via xdm/kdm. This is
really a problem with utmp/wtmp, but takes the same approach as who(1).

Reviewed by: knu (mentor), mini, silence on -audit
Approved by: knu (mentor), mini


97981 07-Jun-2002 jmallett

ANSI style function declarations.


96247 09-May-2002 joe

Replace /kernel with /boot/kernel/kernel.

PR: docs/37757
Submitted by: Hiten Pandya <hiten@uk.FreeBSD.org>


92922 22-Mar-2002 imp

remove __P


91837 07-Mar-2002 obrien

Back out part of rev 1.51. The lesser impact fix is to just remove
the unused global var.


87674 11-Dec-2001 markm

WARNS=2 fix, use __FBSDID() and sort includes.

WARNS=2 not added to Makefile as it is to become default.


84768 10-Oct-2001 bde

Compensate for "Compensate for header dethreading" by backing it out.


83815 22-Sep-2001 cjc

Fixing a bug that causes very short uptimes (less than one minute) to
be 30 seconds off. (Thanks to Vladimir B.Grebenschikov
<vova@express.ru> for the PR and ru for a more elegant fix.)

PR: bin/30680
Approved by: ru


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


80407 26-Jul-2001 brian

When -n is specified, don't attempt to turn hostnames found in utmp
into addresses as we have no idea what address family they belong to.

When -n is not specified, resolve IPv6 as well as IPv4 addresses found
in the host field of utmp. Use realhostname_sa() to resolve addresses
(the old code was wrong).

Rename ``x'' to ``x_suffix'' to avoid confusion.

Hard code the host column width to 16 (against the imminent increase
of UT_HOSTSIZE in utmp.h).


79755 15-Jul-2001 dd

Remove whitespace at EOL.


79535 10-Jul-2001 ru

mdoc(7) police: removed HISTORY info from the .Os call.


77367 28-May-2001 phk

Call kvm_close() before exit for consistency.

PR: 24654
Submitted by: Daniel Hemmerich zartik@yahoo.com


77212 26-May-2001 tmm

Fix the error buffer passed to kvm_openfiles to have a correct length
of _POSIX2_LINE_MAX.

MFC after: 1 week


76169 01-May-2001 markm

Compensate for header dethreading.


74848 27-Mar-2001 ru

MAN[1-9] -> MAN.


74603 21-Mar-2001 ache

Fix width for printing time


73385 03-Mar-2001 ache

Preserve comma as separator when it is not equal to radix character


73368 03-Mar-2001 ache

Don't use "," as load avg. separator because it can be precision point in some
locales, so leads to confusion


73366 02-Mar-2001 ache

Oops, remove tabs sneaked in wrong place


73365 02-Mar-2001 ache

Use AM/PM time only when available in locale


71592 24-Jan-2001 jhb

Catch up to proc flag changes.


70272 22-Dec-2000 brian

Hostnames are case-insensitive


70242 21-Dec-2000 brian

If the utmp login time is greater than the tty atime, use it to calculate
the idle time instead of the atime.

This makes entries for people that have logged in but done nothing
else show up correctly.

Reviewed by: markk@knigma.org


70197 19-Dec-2000 ru

Prepare for mdoc(7)NG.


69896 12-Dec-2000 mckusick

Change the proc information returned from the kernel so that it
no longer contains kernel specific data structures, but rather
only scalar values and structures that are already part of the
kernel/user interface, specifically rusage and rtprio. It no
longer contains proc, session, pcred, ucred, procsig, vmspace,
pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If
any of these changed in size, ps, w, fstat, gcore, systat, and
top would all stop working. The new structure has over 200 bytes
of unassigned space for future values to be added, yet is nearly
100 bytes smaller per entry than the structure that it replaced.


68963 20-Nov-2000 ru

mdoc(7) police: use the new features of the Nm macro.


53279 17-Nov-1999 peter

Use the same technique as ps(1) to avoid the need for setgid. (ie: use
/dev/null as the default kernel and /dev/mem filenames, but still allow
the usual overrides)


53073 10-Nov-1999 davidn

Fix cosmetic bug in time display. Current day logins are now displayed
as plain time as originally intended, instead of displaying DayHH times
when the login time happens to be prior the GMT - TZ difference.
(Only noticable on systems operating east of GMT/UTC).
Local times are now used to determine the day.


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49177 28-Jul-1999 green

New w ability: you can list multiple users on the command line and it will
match with all of them, rather than only supporting a single user.

PR: 11121
Kinda submitted by: James Howard <howardjp@byzantine.student.umd.edu>
Reviewed by: DES


48792 12-Jul-1999 nik

Add $Id$, to make it simpler for members of the translation teams to
track.

The $Id$ line is normally at the bottom of the main comment block in the
man page, separated from the rest of the manpage by an empty comment,
like so;

.\" $Id$
.\"

If the immediately preceding comment is a @(#) format ID marker than the
the $Id$ will line up underneath it with no intervening blank lines.
Otherwise, an additional blank line is inserted.

Approved by: bde


48566 04-Jul-1999 billf

Clean up some ambiguous nested if/elses.


45946 22-Apr-1999 ache

fix -n with 16-chars hostnames, modified patch from PR

PR: 11286
Submitted by: Hans Huebner <hans@chaosradio.berlin.ccc.de>


45201 31-Mar-1999 brian

Get things right for tty names of length UT_LINESIZE.
Cosmetic: Don't shadow the `p' variable.
Remove two unused variables.
PR: 3638


42481 10-Jan-1999 peter

Fix the annoying bug introduced in rev 1.18 that caused each line to be
one character shorter than the previous in a stairstep fashion when long
idle times were involved.

A couple of nits:
- spelling/typo fix.
- some of the easier style(9) fixes where it was bothering me.
- Handle 100+ days idle time (ha!). Probably the right thing to do is
to do a snprintf into a buffer and strlen the result rather than doing
hackery on magic numbers.

XXX the wide (and mostly unused) username and tty columns annoy me since
it it could be used for more useful information for the command. We should
actually count the largest username and tty and adjust like 'ls -l' does.


42055 24-Dec-1998 dillon

No __profname bozoness, no strstr() bozoness... test argv[0] against
"uptime" the right way. Sheesh.


42050 24-Dec-1998 steve

Since argv is in scope, use argv[0] instead of __progname.

Suggested by: bde


41022 09-Nov-1998 steve

Do a better job of determining if we were called as uptime(1).

PR: 8593


36793 09-Jun-1998 imp

Remove unused strvisx.


36276 21-May-1998 jkoshy

Cosmetic fix. Compute header field widths from UT_{HOST,LINE,NAME}SIZE
instead of hardcoding header line.

PR: 6325


36031 14-May-1998 jkoshy

Allow `w' to treat a corrupted "utmp" as a non fatal error.

PR: bin/2832


35309 19-Apr-1998 phk

Like most Unices FreeBSD should have a larger tty field at least
as large as UT_LINESIZE (/usr/include/utmp.h). If the tty name is logged
with this size why isn't the w command reporting it?

(We should probably report the tty/cua prefix then as well ? /phk)

PR: 4187
Reviewed by: phk
Submitted by: Jorge M. Goncalves <ee96199@tom.fe.up.pt>


34781 22-Mar-1998 steve

Reword using who.1 as a good example of where to start.

Submitted by: bde


32452 12-Jan-1998 steve

Reword the synopsis line so that it makes sense.


32055 28-Dec-1997 alex

-Wall cleanup.


30389 13-Oct-1997 ache

If uptime < 1 min print in in secs otherwise we got confusing message
"up 1 user"


29311 12-Sep-1997 ache

Document newly added -d option and fix usage string


29310 12-Sep-1997 ache

The "-d" option dumps out the entire process list on a per controlling
tty basis, instead of just the top level process.
Submitted by: terry


28785 26-Aug-1997 charnier

Revert some casts I introduced.
Requested by: Bruce.


28694 25-Aug-1997 charnier

Typo in usage(). Err -> errx when testing allocations.


24360 29-Mar-1997 imp

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


23493 07-Mar-1997 yokota

Made sure the string formated by strftime() is properly
null-terminated.

Should go to RELENG_2_1 and RELENG_2_2.

Reviewed by guido@freebsd.org.


23012 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


22558 11-Feb-1997 danny

Reduce the command field width by one when idle time is > 9 days, to
eliminate unsightly blank line.

Possibly a 2.2 candidate.


21748 15-Jan-1997 wosch

Sort cross references.


21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


20888 23-Dec-1996 wosch

comma typos


20155 05-Dec-1996 ache

Increase username field to reflect utmp changes


16455 17-Jun-1996 ache

Do not print herror message, if w -n gethostname failed to be 100%
compatible with any program
Suggested by: peter


16446 17-Jun-1996 ache

Fix xterm/screen/(any program using just :xxx form) compatibility


16443 17-Jun-1996 ache

Don't try convert "-" to numeric form for -n option


16436 17-Jun-1996 ache

Fix w -n to really show numeric addresses, close PR 402
Partially submitted by: henrich@msu.edu (Charles Henrich)


15993 30-May-1996 pst

Drop privileges if not using standard namelist or kernel file.
Submitted by: smpatel (Sujal Patel)


11811 26-Oct-1995 ache

Change locale to LC_ALL, there is no bitmask


11755 24-Oct-1995 ache

Add setlocale LC_TIME|LC_CTYPE


11339 08-Oct-1995 ache

Fix one column wrong offset in previous change days->day


10948 22-Sep-1995 dima

Print "1day" instead of "1days"


10553 04-Sep-1995 peter

Increase the tty column width from 2 to 3 characters.

This gives us more room to breath with tty names, especially with drivers
that support large numbers of ports.. eg: specialix and digiboard.

This does not actually change the current tty names, it just allows room
for reporting more characters if the drivers use them.


9987 07-Aug-1995 wollman

Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.


9573 18-Jul-1995 peter

When 'w' finds an IP address in the ut_host field, it attempts to do
a gethostbyname() on it. That can take a long time... (especially
if the reason the IP address is in there in the first place is because
login/rlogind/telnetd couldn't find it either....)
This patch reduces the gethostbyaddr lookup time to 2 seconds, the idea being
that if the local nameserver knows the answer, it'll answer within that time,
otherwise we dont care... :-)
This change doesn't do anything about whether or not w should do this in the
first place, but at least it will make the current behavior less painful.
Reviewed by: David Greenman


9555 17-Jul-1995 peter

Fix the 'w' command so that the -h option correctly supresses the heading
as per the manual page. Closes PR578.
Reviewed by:
Submitted by: Kenneth D. Merry
Obtained from:


8874 30-May-1995 rgrimes

Remove trailing whitespace.


8555 16-May-1995 dg

If an ut_host field in an utmp entry contains a ':' (e.g. for an xterm session)
w doesn't handle the non-'\0' terminated char arrays in struct utmp properly.

Submitted by: jarle@idt.unit.no


7837 15-Apr-1995 dg

Install with default BINOWN (as it once used to be).


7836 15-Apr-1995 dg

Install setgid kmem rather than setuid root. The problem with procfs that
was breaking this before has been fixed.


6542 18-Feb-1995 smace

Correct the grammar for the label of the number of users.
It is plural when zero and >1 users are logged in.


3138 27-Sep-1994 ache

idle time == 0 printed now as "-" like in good old BSD
skip cua* 3 chars as tty* 3 lchars


2033 11-Aug-1994 wollman

Make it set-uid until procfs is fixed.


1866 05-Aug-1994 wollman

More merry makefile munging for man page compatability.


1856 05-Aug-1994 dg

Converted 'vmunix' to 'kernel'.


1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.