History log of /freebsd-current/usr.bin/who/who.c
Revision Date Author Comments
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix


# db11c57a 12-Mar-2022 Steve Wills <swills@FreeBSD.org>

usr.bin/who.c: Fix boot time checking

The boot time entry doesn't have a tty specified, so don't check it.
While here, make ttystat handle that case.

Approved by: kevans (src)
Differential Revision: https://reviews.freebsd.org/D34524


# 1de7b4b8 27-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

various: general adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.


# bab1d5b8 11-Feb-2012 Ed Schouten <ed@FreeBSD.org>

And of course, I forgot to add -a to the usage.


# 79625d00 11-Feb-2012 Ed Schouten <ed@FreeBSD.org>

Attempt to implement who -a.

According to POSIX, -a is equal to -bdlprtTu. It seems this is not true
in practice, as -b normally restricts the output to BOOT_TIME entries
and all implementations that I know of don't.


# 85714224 27-Oct-2011 Sergey Kandaurov <pluknet@FreeBSD.org>

Add the XSI option -b to show date of the last reboot.

That required to increase the LINE field to fit the output of -b.
While here, change the row() function to take a const argument.

In collaboration with: ed


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# ab90a4d1 13-Jan-2010 Ed Schouten <ed@FreeBSD.org>

Perform all trivial ports to utmpx for usr.bin/.

They were already converted to use libulog, so it's easy to convert them
to utmpx.


# 444999a3 26-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Several refinements to libulog's API.

- Only set the fields in the ulog_utmpx structure that are valid for the
command in question. This means that strings like "shutdown" or "~"
are not visible to the user anymore.
- Rename UTXF_* to UTXI_*, indicating the indexation, instead of using
the `antique' filename. If we ever get rid of utmp, it makes little
sense calling it by its old name.


# 821df508 12-Dec-2009 Xin LI <delphij@FreeBSD.org>

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


# 6f2d3221 11-Dec-2009 Xin LI <delphij@FreeBSD.org>

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

Tested with: make universe


# b911cea8 05-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Port who(1) to utmpx.

(Un)fortunately there is no standardized interface to switch between
utmp database files, so we must call ulog_setutxfile() here.

I'm also changing the column widths to magic numbers here. Display
layout should in this case not be derived from structure fields sizes.
Because I don't want struct utmpx ever to become too small, the fields
are too big to reserve all the space.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# b457a3e1 21-Feb-2006 Olivier Houchard <cognet@FreeBSD.org>

In wall and who, check that the utmp entry isn't stalled, as it is done in w.
Apparently with the new pts code stalled entries are printed, when they are
not with the BSD ptys.

Submitted by: Michal Mertl <mime at traveller dot cz>


# 8a9d84b4 29-May-2005 Philippe Charnier <charnier@FreeBSD.org>

Move variable initialization to reduce compiler warning.


# 10ebb45a 25-Oct-2003 Peter Wemm <peter@FreeBSD.org>

Fix a warning that showed up on 64 bit systems. It was actually a real
bug that had been swept under the carpet.


# aed62c09 20-Dec-2002 Tim J. Robbins <tjr@FreeBSD.org>

Remove unimplemented System V options from the getopt() option string.


# 6ceeb690 15-Nov-2002 Peter Wemm <peter@FreeBSD.org>

utmp.ut_time and lastlog.ll_time are explicitly int32_t rather than
time_t. Deal with the possibility that time_t != int32_t. This boils
down to this sort of thing:
- time(&ut.ut_time);
+ ut.ut_time = time(NULL);
and similar for ctime(3) etc. I've kept it minimal for the stuff
that may need to be portable (or 3rd party code), but used Matt's time32
stuff for cases where that isn't as much of a concern.

Approved by: re (jhb)


# d2979f56 20-Jun-2002 Tim J. Robbins <tjr@FreeBSD.org>

Style: put static qualifier on definition of static functions.


# 8358edb6 04-Jun-2002 Tim J. Robbins <tjr@FreeBSD.org>

Respect the setting of the COLUMNS environment variable, use it instead of
the TTY width obtained by ioctl() when set & non-null. (SUSv3)


# 1a940138 28-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

Write "FROM" heading above the hostname column, like NetBSD and GNU do.


# 38a99942 09-May-2002 Tim J. Robbins <tjr@FreeBSD.org>

Reimplement the who(1) utility to add some features required by SUSv3:
-H option (show column headings),
-T (show mesg(1) state),
-m (same as "am I"),
-u (show idle time),
-q (quick mode; list names in columns).

PR: 36128
Reviewed by: mike


# 3f330d7d 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

remove __P


# 2c062c85 11-Dec-2001 Mark Murray <markm@FreeBSD.org>

WARNS=2 fix, use __FBSDID().

WARNS=2 is not in Makefile, as this will be the default.


# 7a19d1bb 24-Jun-2001 Dima Dorfman <dd@FreeBSD.org>

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


# e36de81e 21-Mar-2001 Andrey A. Chernov <ache@FreeBSD.org>

Don't attempt to parse %c


# c3aac50f 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# 7ac237e8 24-May-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Back out Steve's fix, as this was already fixed by me in revision 1.6


# af2bbadb 25-May-1998 Steve Price <steve@FreeBSD.org>

Only allow 'who' and 'who am i' as valid usages.

PR: 6294
Submitted by: Ruslan Ermilov <ru@ucb.crimea.ua>


# 574a97f5 26-Apr-1998 Dag-Erling Smørgrav <des@FreeBSD.org>

Check that user really typed "who am {I,i}", and that no stray
arguments are given.
Note that usage() and the manpage disagree...

PR: bin/6294
Suggested by: Ruslan Ermilov and Bruce Evans
Submitted by: Ruslan Ermilov (partly)


# 0abcff76 26-Aug-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3). Add usage().


# 719ed69e 07-Mar-1997 Kazutaka YOKOTA <yokota@FreeBSD.org>

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

Fixed a wrong if statement which should test a string is
empty where in fact it tested the string pointer was NULL.

Should go to RELENG_2_1 and RELENG_2_2.

Reviewed by guido@freebsd.org.


# 965f310c 23-Oct-1995 Andrey A. Chernov <ache@FreeBSD.org>

Add setlocale LC_TIME


# eaf7e02e 07-Aug-1995 Andrey A. Chernov <ache@FreeBSD.org>

Replace ctime by strftime %c to use national date representation now


# 9b50d902 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite Usr.bin Sources