Commit Graph

61 Commits

Author SHA1 Message Date
jhb
eb5ace8fd3 Catch up to proc flag changes. 2001-01-24 14:28:24 +00:00
brian
b1b8e786c7 Hostnames are case-insensitive 2000-12-22 15:21:06 +00:00
brian
33a704848b 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
2000-12-21 01:30:47 +00:00
ru
655e7db87e Prepare for mdoc(7)NG. 2000-12-19 16:00:12 +00:00
mckusick
7d330b9cd3 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.
2000-12-12 07:25:57 +00:00
ru
0957874304 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 19:21:22 +00:00
peter
93d5ed90b5 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)
1999-11-17 15:28:45 +00:00
davidn
c7e356200e 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.
1999-11-10 04:28:16 +00:00
peter
e4b04a2b21 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
green
e7bca286f2 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
1999-07-28 19:29:46 +00:00
nik
7e91e73b9f 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
1999-07-12 20:24:20 +00:00
billf
251664b7db Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
ache
763523f45e fix -n with 16-chars hostnames, modified patch from PR
PR: 11286
Submitted by:  Hans Huebner <hans@chaosradio.berlin.ccc.de>
1999-04-22 23:40:56 +00:00
brian
5903778a46 Get things right for tty names of length UT_LINESIZE.
Cosmetic: Don't shadow the `p' variable.
          Remove two unused variables.
PR:	3638
1999-03-31 21:01:39 +00:00
peter
cf1f675801 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.
1999-01-10 15:28:37 +00:00
dillon
831371aa9a No __profname bozoness, no strstr() bozoness... test argv[0] against
"uptime" the right way.  Sheesh.
1998-12-24 23:27:33 +00:00
steve
83b6423cde Since argv is in scope, use argv[0] instead of __progname.
Suggested by:	bde
1998-12-24 18:20:58 +00:00
steve
0e1e2dce28 Do a better job of determining if we were called as uptime(1).
PR:		8593
1998-11-09 01:19:30 +00:00
imp
bb281813c3 Remove unused strvisx. 1998-06-09 04:35:20 +00:00
jkoshy
c207ed5f6d Cosmetic fix. Compute header field widths from UT_{HOST,LINE,NAME}SIZE
instead of hardcoding header line.

PR: 6325
1998-05-21 08:46:48 +00:00
jkoshy
94a58195db Allow `w' to treat a corrupted "utmp" as a non fatal error.
PR: bin/2832
1998-05-14 10:13:24 +00:00
phk
40fc7e350b 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>
1998-04-19 18:32:01 +00:00
steve
2f30e90cd2 Reword using who.1 as a good example of where to start.
Submitted by:	bde
1998-03-22 17:39:08 +00:00
steve
e233d017a1 Reword the synopsis line so that it makes sense. 1998-01-12 00:47:52 +00:00
alex
94f816d6c5 -Wall cleanup. 1997-12-28 17:50:10 +00:00
ache
2147d72e7d If uptime < 1 min print in in secs otherwise we got confusing message
"up 1 user"
1997-10-13 15:17:03 +00:00
ache
bbeef177db Document newly added -d option and fix usage string 1997-09-12 02:26:12 +00:00
ache
fa1b31c010 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
1997-09-12 02:22:21 +00:00
charnier
46dded5c2b Revert some casts I introduced.
Requested by: Bruce.
1997-08-26 06:59:34 +00:00
charnier
2e1acbcf73 Typo in usage(). Err -> errx when testing allocations. 1997-08-25 06:42:19 +00:00
imp
cd84ece5fd compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 04:34:07 +00:00
yokota
9aad15b168 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.
1997-03-07 10:54:19 +00:00
peter
aef78d145b Revert $FreeBSD$ to $Id$ 1997-02-22 19:58:13 +00:00
danny
663bdecfe6 Reduce the command field width by one when idle time is > 9 days, to
eliminate unsightly blank line.

Possibly a 2.2 candidate.
1997-02-11 10:49:25 +00:00
wosch
ab0d7e7c60 Sort cross references. 1997-01-15 23:25:55 +00:00
jkh
9c0cd3f9df 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.
1997-01-14 07:20:47 +00:00
wosch
15e449c60d comma typos 1996-12-23 23:09:55 +00:00
ache
8c018aad6c Increase username field to reflect utmp changes 1996-12-05 17:00:16 +00:00
ache
0ecb02f778 Do not print herror message, if w -n gethostname failed to be 100%
compatible with any program
Suggested by: peter
1996-06-17 20:07:44 +00:00
ache
4337e3a005 Fix xterm/screen/(any program using just :xxx form) compatibility 1996-06-17 19:23:38 +00:00
ache
f372dabd3c Don't try convert "-" to numeric form for -n option 1996-06-17 18:35:16 +00:00
ache
f1b02742db Fix w -n to really show numeric addresses, close PR 402
Partially submitted by: henrich@msu.edu (Charles Henrich)
1996-06-17 15:46:25 +00:00
pst
5ebfd20516 Drop privileges if not using standard namelist or kernel file.
Submitted by:	smpatel (Sujal Patel)
1996-05-30 02:20:10 +00:00
ache
20993030f0 Change locale to LC_ALL, there is no bitmask 1995-10-26 11:03:08 +00:00
ache
db19b20652 Add setlocale LC_TIME|LC_CTYPE 1995-10-24 03:06:09 +00:00
ache
5b6fd9adec Fix one column wrong offset in previous change days->day 1995-10-08 23:16:45 +00:00
dima
39cde480f2 Print "1day" instead of "1days" 1995-09-22 00:50:37 +00:00
peter
bbe961035e 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.
1995-09-04 01:22:54 +00:00
wollman
01cdce9796 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00
peter
a066aa2292 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
1995-07-18 05:07:02 +00:00