svn commit: r226932 - in user/attilio/vmcontention: contrib/top etc/rc.d games/fortune/datfiles sbin/fdisk share/mk sys/dev/ath sys/dev/mfi sys/dev/syscons sys/dev/tws sys/dev/usb sys/geom/part sys...

Attilio Rao attilio at FreeBSD.org
Sun Oct 30 11:43:15 UTC 2011


Author: attilio
Date: Sun Oct 30 11:43:12 2011
New Revision: 226932
URL: http://svn.freebsd.org/changeset/base/226932

Log:
  MFC

Added:
  user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0
     - copied unchanged from r226931, head/tools/regression/bin/sh/builtins/for1.0
Modified:
  user/attilio/vmcontention/etc/rc.d/dhclient
  user/attilio/vmcontention/games/fortune/datfiles/fortunes
  user/attilio/vmcontention/sbin/fdisk/fdisk.c
  user/attilio/vmcontention/sys/dev/ath/if_ath.c
  user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h
  user/attilio/vmcontention/sys/dev/mfi/mfivar.h
  user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c
  user/attilio/vmcontention/sys/dev/tws/tws_services.c
  user/attilio/vmcontention/sys/dev/tws/tws_services.h
  user/attilio/vmcontention/sys/dev/usb/usb_device.c
  user/attilio/vmcontention/sys/dev/usb/usb_msctest.c
  user/attilio/vmcontention/sys/geom/part/g_part.c
  user/attilio/vmcontention/sys/kern/kern_sig.c
  user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c
  user/attilio/vmcontention/sys/vm/vm_contig.c
  user/attilio/vmcontention/sys/vm/vm_extern.h
  user/attilio/vmcontention/sys/vm/vm_phys.c
  user/attilio/vmcontention/sys/vm/vm_phys.h
  user/attilio/vmcontention/sys/vm/vm_reserv.c
  user/attilio/vmcontention/sys/vm/vm_reserv.h
  user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday
  user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd
  user/attilio/vmcontention/usr.bin/sed/sed.1
  user/attilio/vmcontention/usr.bin/who/who.1
  user/attilio/vmcontention/usr.bin/who/who.c
Directory Properties:
  user/attilio/vmcontention/   (props changed)
  user/attilio/vmcontention/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/contrib/bind9/   (props changed)
  user/attilio/vmcontention/contrib/binutils/   (props changed)
  user/attilio/vmcontention/contrib/bzip2/   (props changed)
  user/attilio/vmcontention/contrib/com_err/   (props changed)
  user/attilio/vmcontention/contrib/compiler-rt/   (props changed)
  user/attilio/vmcontention/contrib/dialog/   (props changed)
  user/attilio/vmcontention/contrib/ee/   (props changed)
  user/attilio/vmcontention/contrib/expat/   (props changed)
  user/attilio/vmcontention/contrib/file/   (props changed)
  user/attilio/vmcontention/contrib/gcc/   (props changed)
  user/attilio/vmcontention/contrib/gdb/   (props changed)
  user/attilio/vmcontention/contrib/gdtoa/   (props changed)
  user/attilio/vmcontention/contrib/gnu-sort/   (props changed)
  user/attilio/vmcontention/contrib/groff/   (props changed)
  user/attilio/vmcontention/contrib/less/   (props changed)
  user/attilio/vmcontention/contrib/libpcap/   (props changed)
  user/attilio/vmcontention/contrib/libstdc++/   (props changed)
  user/attilio/vmcontention/contrib/llvm/   (props changed)
  user/attilio/vmcontention/contrib/llvm/tools/clang/   (props changed)
  user/attilio/vmcontention/contrib/ncurses/   (props changed)
  user/attilio/vmcontention/contrib/netcat/   (props changed)
  user/attilio/vmcontention/contrib/ntp/   (props changed)
  user/attilio/vmcontention/contrib/one-true-awk/   (props changed)
  user/attilio/vmcontention/contrib/openbsm/   (props changed)
  user/attilio/vmcontention/contrib/openpam/   (props changed)
  user/attilio/vmcontention/contrib/openresolv/   (props changed)
  user/attilio/vmcontention/contrib/pf/   (props changed)
  user/attilio/vmcontention/contrib/sendmail/   (props changed)
  user/attilio/vmcontention/contrib/tcpdump/   (props changed)
  user/attilio/vmcontention/contrib/tcsh/   (props changed)
  user/attilio/vmcontention/contrib/tnftp/   (props changed)
  user/attilio/vmcontention/contrib/top/   (props changed)
  user/attilio/vmcontention/contrib/top/install-sh   (props changed)
  user/attilio/vmcontention/contrib/tzcode/stdtime/   (props changed)
  user/attilio/vmcontention/contrib/tzcode/zic/   (props changed)
  user/attilio/vmcontention/contrib/tzdata/   (props changed)
  user/attilio/vmcontention/contrib/wpa/   (props changed)
  user/attilio/vmcontention/contrib/xz/   (props changed)
  user/attilio/vmcontention/crypto/heimdal/   (props changed)
  user/attilio/vmcontention/crypto/openssh/   (props changed)
  user/attilio/vmcontention/crypto/openssl/   (props changed)
  user/attilio/vmcontention/gnu/lib/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/binutils/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/cc/cc_tools/   (props changed)
  user/attilio/vmcontention/gnu/usr.bin/gdb/   (props changed)
  user/attilio/vmcontention/lib/libc/   (props changed)
  user/attilio/vmcontention/lib/libc/stdtime/   (props changed)
  user/attilio/vmcontention/lib/libutil/   (props changed)
  user/attilio/vmcontention/lib/libz/   (props changed)
  user/attilio/vmcontention/sbin/   (props changed)
  user/attilio/vmcontention/sbin/ipfw/   (props changed)
  user/attilio/vmcontention/share/mk/bsd.arch.inc.mk   (props changed)
  user/attilio/vmcontention/share/zoneinfo/   (props changed)
  user/attilio/vmcontention/sys/   (props changed)
  user/attilio/vmcontention/sys/amd64/include/xen/   (props changed)
  user/attilio/vmcontention/sys/boot/   (props changed)
  user/attilio/vmcontention/sys/boot/i386/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/efi/   (props changed)
  user/attilio/vmcontention/sys/boot/ia64/ski/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/boot1.chrp/   (props changed)
  user/attilio/vmcontention/sys/boot/powerpc/ofw/   (props changed)
  user/attilio/vmcontention/sys/cddl/contrib/opensolaris/   (props changed)
  user/attilio/vmcontention/sys/conf/   (props changed)
  user/attilio/vmcontention/sys/contrib/dev/acpica/   (props changed)
  user/attilio/vmcontention/sys/contrib/octeon-sdk/   (props changed)
  user/attilio/vmcontention/sys/contrib/pf/   (props changed)
  user/attilio/vmcontention/sys/contrib/x86emu/   (props changed)
  user/attilio/vmcontention/usr.bin/calendar/   (props changed)
  user/attilio/vmcontention/usr.bin/csup/   (props changed)
  user/attilio/vmcontention/usr.bin/procstat/   (props changed)
  user/attilio/vmcontention/usr.sbin/ndiscvt/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvctl/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtadvd/   (props changed)
  user/attilio/vmcontention/usr.sbin/rtsold/   (props changed)
  user/attilio/vmcontention/usr.sbin/zic/   (props changed)

Modified: user/attilio/vmcontention/etc/rc.d/dhclient
==============================================================================
--- user/attilio/vmcontention/etc/rc.d/dhclient	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/etc/rc.d/dhclient	Sun Oct 30 11:43:12 2011	(r226932)
@@ -15,9 +15,21 @@ name="dhclient"
 rcvar=
 pidfile="/var/run/${name}.${ifn}.pid"
 start_precmd="dhclient_prestart"
+stop_precmd="dhclient_pre_check"
+
+# rc_force check can only be done at the run_rc_command
+# time, so we're testing it in the pre* hooks.
+dhclient_pre_check()
+{
+	if [ -z "${rc_force}" ] && ! dhcpif $ifn; then
+		err 1 "'$ifn' is not a DHCP-enabled interface"
+	fi
+}
 
 dhclient_prestart()
 {
+	dhclient_pre_check
+
 	# Interface-specific flags (see rc.subr for $flags setting)
 	specific=$(get_if_var $ifn dhclient_flags_IF)
 	if [ -z "$flags" -a -n "$specific" ]; then
@@ -38,11 +50,8 @@ load_rc_config network
 if [ -z $ifn ] ; then
 	# only complain if a command was specified but no interface
 	if [ -n "$1" ] ; then
-		echo 1>&2 "$0: no interface specified"
-		return 1
+		err 1 "$0: no interface specified"
 	fi
-elif [ -z "${rc_force}" ] && ! dhcpif $ifn; then
-	return 1
 fi
 
 run_rc_command "$1"

Modified: user/attilio/vmcontention/games/fortune/datfiles/fortunes
==============================================================================
--- user/attilio/vmcontention/games/fortune/datfiles/fortunes	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/games/fortune/datfiles/fortunes	Sun Oct 30 11:43:12 2011	(r226932)
@@ -4942,25 +4942,37 @@ cats on the dinette table, etc.
 	"That stop him?"
 	"No, but it sure slowed him up."
 %
-	Youth is not a time of life, it is a state of mind; it is a temper of
-the will, a quality of the imagination, a vigor of the emotions, a predominance
-of courage over timidity, of the appetite for adventure over love of ease.
-	Nobody grows old by merely living a number of years; people grow
-old only by deserting their ideals.  Years wrinkle the skin, but to give up
-enthusiasm wrinkles the soul.  Worry, doubt, self-distrust, fear, and despair
--- these are the long, long years that bow the head and turn the growing spirit
-back to dust.
-	Whether seventy or sixteen, there is in every being's heart the love
-of wonder, the sweet amazement at the stars and the starlike things and
-thoughts, the undaunted challenge of events, the unfailing childlike appetite
-for what next, and the joy and the game of life.
-	You are as young as your faith, as old as your doubt; as young as your
-self-confidence, as old as your fear, as young as your hope, as old as your
-despair.
-	So long as your heart receives messages of beauty, cheer, courage,
-grandeur and power from the earth, from man, and from the Infinite, so long
-you are young.
-		-- Samuel Ullman
+	Youth is not a time of life--it is a state of mind. It is not a
+matter of red cheeks, red lips and supple knees. It is a temper of the
+will; a quality of the imagination; a vigor of the emotions; it is a
+freshness of the deep springs of life.  Youth means a tempermental
+predominance of courage over timidity, of the appetite for adventure
+over a life of ease.  This often exists in a man of fifty, more than in
+a boy of twenty.  Nobody grows old by merely living a number of years;
+people grow old by deserting their ideals.
+
+	Years may wrinkle the skin, but to give up enthusiasm wrinkles
+the soul.  Worry, doubt, self-distrust, fear and despair--these are the
+long, long years that bow the head and turn the growing spirit back to
+dust.
+
+	Whether seventy or sixteen, there is in every being’s heart a
+love of wonder; the sweet amazement at the stars and starlike things and
+thoughts; the undaunted challenge of events, the unfailing childlike
+appetite for what comes next, and the joy in the game of life.
+
+	You are as young as your faith, as old as your doubt; as young
+as your self-confidence, as old as your fear, as young as your hope, as
+old as your despair.
+
+	In the central place of your heart there is a wireless station.
+So long as it receives messages of beauty, hope, cheer, grandeur,
+courage, and power from the earth, from men and from the Infinite--so
+long are you young.  When the wires are all down and the central places
+of your heart are covered with the snows of pessimism and the ice of
+cynicism, then are you grown old, indeed!
+		-- Samuel Ullman, "Youth" (1934), as published in
+		   The Silver Treasury, Prose and Verse for Every Mood
 %
 " "
 		-- Charlie Chaplin

Modified: user/attilio/vmcontention/sbin/fdisk/fdisk.c
==============================================================================
--- user/attilio/vmcontention/sbin/fdisk/fdisk.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sbin/fdisk/fdisk.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -487,7 +487,7 @@ print_part(const struct dos_partition *p
 	    get_type(partp->dp_typ));
 	printf("    start %lu, size %lu (%ju Meg), flag %x%s\n",
 		(u_long)partp->dp_start,
-		(u_long)partp->dp_size, 
+		(u_long)partp->dp_size,
 		(uintmax_t)part_mb,
 		partp->dp_flag,
 		partp->dp_flag == ACTIVE ? " (active)" : "");
@@ -513,6 +513,8 @@ init_boot(void)
 	if ((fdesc = open(fname, O_RDONLY)) == -1 ||
 	    fstat(fdesc, &sb) == -1)
 		err(1, "%s", fname);
+	if (sb.st_size == 0)
+		errx(1, "%s is empty, must not be.", fname);
 	if ((mboot.bootinst_size = sb.st_size) % secsize != 0)
 		errx(1, "%s: length must be a multiple of sector size", fname);
 	if (mboot.bootinst != NULL)
@@ -890,7 +892,7 @@ write_s0()
 		dos_partition_enc(&mboot.bootinst[DOSPARTOFF + i * DOSPARTSIZE],
 		    &mboot.parts[i]);
 	le16enc(&mboot.bootinst[DOSMAGICOFFSET], DOSMAGIC);
-	for(sector = 0; sector < mboot.bootinst_size / secsize; sector++) 
+	for(sector = 0; sector < mboot.bootinst_size / secsize; sector++)
 		if (write_disk(sector,
 			       &mboot.bootinst[sector * secsize]) == -1) {
 			warn("can't write fdisk partition table");
@@ -1111,7 +1113,7 @@ str2sectors(const char *str)
 		return NO_DISK_SECTORS;
 	}
 
-	if (*end == 'K') 
+	if (*end == 'K')
 		val *= 1024UL / secsize;
 	else if (*end == 'M')
 		val *= 1024UL * 1024UL / secsize;

Modified: user/attilio/vmcontention/sys/dev/ath/if_ath.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -3624,8 +3624,10 @@ rx_error:
 				/* NB: bpf needs the mbuf length setup */
 				len = rs->rs_datalen;
 				m->m_pkthdr.len = m->m_len = len;
+				bf->bf_m = NULL;
 				ath_rx_tap(ifp, m, rs, tsf, nf);
 				ieee80211_radiotap_rx_all(ic, m);
+				m_freem(m);
 			}
 			/* XXX pass MIC errors up for s/w reclaculation */
 			goto rx_next;

Modified: user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/ath/if_ath_debug.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -57,6 +57,11 @@ enum { 
 	ATH_DEBUG_TDMA		= 0x00800000,	/* TDMA processing */
 	ATH_DEBUG_TDMA_TIMER	= 0x01000000,	/* TDMA timer processing */
 	ATH_DEBUG_REGDOMAIN	= 0x02000000,	/* regulatory processing */
+	ATH_DEBUG_SW_TX		= 0x04000000,	/* per-packet software TX */
+	ATH_DEBUG_SW_TX_BAW	= 0x08000000,	/* BAW handling */
+	ATH_DEBUG_SW_TX_CTRL	= 0x10000000,	/* queue control */
+	ATH_DEBUG_SW_TX_AGGR	= 0x20000000,	/* aggregate TX */
+	ATH_DEBUG_SW_TX_RETRIES	= 0x40000000,	/* software TX retries */
 	ATH_DEBUG_FATAL		= 0x80000000,	/* fatal errors */
 	ATH_DEBUG_ANY		= 0xffffffff
 };

Modified: user/attilio/vmcontention/sys/dev/mfi/mfivar.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/mfi/mfivar.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/mfi/mfivar.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -352,12 +352,29 @@ mfi_dequeue_bio(struct mfi_softc *sc)
 	return (bp);
 }
 
+/*
+ * This is from the original scsi_extract_sense() in CAM.  It's copied
+ * here because CAM now uses a non-inline version that follows more complex
+ * additions to the SPC spec, and we don't want to force a dependency on
+ * the CAM module for such a trivial action.
+ */
+static __inline void
+mfi_extract_sense(struct scsi_sense_data_fixed *sense,
+    int *error_code, int *sense_key, int *asc, int *ascq)
+{
+
+	*error_code = sense->error_code & SSD_ERRCODE;
+	*sense_key = sense->flags & SSD_KEY;
+	*asc = (sense->extra_len >= 5) ? sense->add_sense_code : 0;
+	*ascq = (sense->extra_len >= 6) ? sense->add_sense_code_qual : 0;
+}
+
 static __inline void
 mfi_print_sense(struct mfi_softc *sc, void *sense)
 {
 	int error, key, asc, ascq;
 
-	scsi_extract_sense((struct scsi_sense_data *)sense,
+	mfi_extract_sense((struct scsi_sense_data_fixed *)sense,
 	    &error, &key, &asc, &ascq);
 	device_printf(sc->mfi_dev, "sense error %d, sense_key %d, "
 	    "asc %d, ascq %d\n", error, key, asc, ascq);

Modified: user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/syscons/scterm-teken.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -424,10 +424,18 @@ static const struct unicp437 cp437table[
 	{ 0x00b6, 0x14, 0x00 }, { 0x00b7, 0xfa, 0x00 },
 	{ 0x00ba, 0xa7, 0x00 }, { 0x00bb, 0xaf, 0x00 },
 	{ 0x00bc, 0xac, 0x00 }, { 0x00bd, 0xab, 0x00 },
-	{ 0x00bf, 0xa8, 0x00 }, { 0x00c4, 0x8e, 0x01 },
-	{ 0x00c6, 0x92, 0x00 }, { 0x00c7, 0x80, 0x00 },
-	{ 0x00c9, 0x90, 0x00 }, { 0x00d1, 0xa5, 0x00 },
-	{ 0x00d6, 0x99, 0x00 }, { 0x00dc, 0x9a, 0x00 },
+	{ 0x00bf, 0xa8, 0x00 }, { 0x00c0, 0x41, 0x00 },
+	{ 0x00c1, 0x41, 0x00 }, { 0x00c2, 0x41, 0x00 },
+	{ 0x00c4, 0x8e, 0x01 }, { 0x00c6, 0x92, 0x00 }, 
+	{ 0x00c7, 0x80, 0x00 }, { 0x00c8, 0x45, 0x00 },
+	{ 0x00c9, 0x90, 0x00 }, { 0x00ca, 0x45, 0x00 },
+	{ 0x00cb, 0x45, 0x00 }, { 0x00cc, 0x49, 0x00 },
+	{ 0x00cd, 0x49, 0x00 }, { 0x00ce, 0x49, 0x00 },
+	{ 0x00cf, 0x49, 0x00 }, { 0x00d1, 0xa5, 0x00 },
+	{ 0x00d2, 0x4f, 0x00 }, { 0x00d3, 0x4f, 0x00 },
+	{ 0x00d4, 0x4f, 0x00 }, { 0x00d6, 0x99, 0x00 }, 
+	{ 0x00d9, 0x55, 0x00 }, { 0x00da, 0x55, 0x00 },
+	{ 0x00db, 0x55, 0x00 }, { 0x00dc, 0x9a, 0x00 },
 	{ 0x00df, 0xe1, 0x00 }, { 0x00e0, 0x85, 0x00 },
 	{ 0x00e1, 0xa0, 0x00 }, { 0x00e2, 0x83, 0x00 },
 	{ 0x00e4, 0x84, 0x00 }, { 0x00e5, 0x86, 0x00 },
@@ -442,6 +450,7 @@ static const struct unicp437 cp437table[
 	{ 0x00f8, 0xed, 0x00 }, { 0x00f9, 0x97, 0x00 },
 	{ 0x00fa, 0xa3, 0x00 }, { 0x00fb, 0x96, 0x00 },
 	{ 0x00fc, 0x81, 0x00 }, { 0x00ff, 0x98, 0x00 },
+	{ 0x013f, 0x4c, 0x00 }, { 0x0140, 0x6c, 0x00 },
 	{ 0x0192, 0x9f, 0x00 }, { 0x0393, 0xe2, 0x00 },
 	{ 0x0398, 0xe9, 0x00 }, { 0x03a3, 0xe4, 0x00 },
 	{ 0x03a6, 0xe8, 0x00 }, { 0x03a9, 0xea, 0x00 },
@@ -490,7 +499,8 @@ static const struct unicp437 cp437table[
 	{ 0x2584, 0xdc, 0x00 }, { 0x2588, 0xdb, 0x00 },
 	{ 0x258c, 0xdd, 0x00 }, { 0x2590, 0xde, 0x00 },
 	{ 0x2591, 0xb0, 0x02 }, { 0x25a0, 0xfe, 0x00 },
-	{ 0x25ac, 0x16, 0x00 }, { 0x25b2, 0x1e, 0x00 },
+	{ 0x25ac, 0x16, 0x00 }, 
+	{ 0x25ae, 0xdb, 0x00 }, { 0x25b2, 0x1e, 0x00 },
 	{ 0x25ba, 0x10, 0x00 }, { 0x25bc, 0x1f, 0x00 },
 	{ 0x25c4, 0x11, 0x00 }, { 0x25cb, 0x09, 0x00 },
 	{ 0x25d8, 0x08, 0x00 }, { 0x25d9, 0x0a, 0x00 },

Modified: user/attilio/vmcontention/sys/dev/tws/tws_services.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/tws/tws_services.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/tws/tws_services.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -53,7 +53,7 @@ struct tws_sense *tws_find_sense_from_mf
 
 
 
-struct error_desc array[] = {
+static struct error_desc array[] = {
     { "Cannot add sysctl tree node", 0x2000, ERROR,
        "%s: (0x%02X: 0x%04X): %s:\n", "ERROR" },
     { "Register window not available", 0x2001, ERROR,

Modified: user/attilio/vmcontention/sys/dev/tws/tws_services.h
==============================================================================
--- user/attilio/vmcontention/sys/dev/tws/tws_services.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/tws/tws_services.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -114,7 +114,6 @@ struct error_desc {
     char *error_str;
 };
 
-extern struct error_desc array[];
 /* ----------- q services ------------- */
 
 #define TWS_FREE_Q        0

Modified: user/attilio/vmcontention/sys/dev/usb/usb_device.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/usb/usb_device.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/usb/usb_device.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -1851,7 +1851,8 @@ repeat_set_config:
 		}
 	}
 	if (set_config_failed == 0 && config_index == 0 &&
-	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0) {
+	    usb_test_quirk(&uaa, UQ_MSC_NO_SYNC_CACHE) == 0 &&
+	    usb_test_quirk(&uaa, UQ_MSC_NO_GETMAXLUN) == 0) {
 
 		/*
 		 * Try to figure out if there are any MSC quirks we

Modified: user/attilio/vmcontention/sys/dev/usb/usb_msctest.c
==============================================================================
--- user/attilio/vmcontention/sys/dev/usb/usb_msctest.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/dev/usb/usb_msctest.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -603,6 +603,29 @@ usb_iface_is_cdrom(struct usb_device *ud
 	return (is_cdrom);
 }
 
+static uint8_t
+usb_msc_get_max_lun(struct usb_device *udev, uint8_t iface_index)
+{
+	struct usb_device_request req;
+	usb_error_t err;
+	uint8_t buf = 0;
+
+
+	/* The Get Max Lun command is a class-specific request. */
+	req.bmRequestType = UT_READ_CLASS_INTERFACE;
+	req.bRequest = 0xFE;		/* GET_MAX_LUN */
+	USETW(req.wValue, 0);
+	req.wIndex[0] = iface_index;
+	req.wIndex[1] = 0;
+	USETW(req.wLength, 1);
+
+	err = usbd_do_request(udev, NULL, &req, &buf);
+	if (err)
+		buf = 0;
+
+	return (buf);
+}
+
 usb_error_t
 usb_msc_auto_quirk(struct usb_device *udev, uint8_t iface_index)
 {
@@ -622,6 +645,11 @@ usb_msc_auto_quirk(struct usb_device *ud
 	 */
 	usb_pause_mtx(NULL, hz);
 
+	if (usb_msc_get_max_lun(udev, iface_index) == 0) {
+		DPRINTF("Device has only got one LUN.\n");
+		usbd_add_dynamic_quirk(udev, UQ_MSC_NO_GETMAXLUN);
+	}
+
 	is_no_direct = 1;
 	for (timeout = 4; timeout; timeout--) {
 		err = bbb_command_start(sc, DIR_IN, 0, sc->buffer,

Modified: user/attilio/vmcontention/sys/geom/part/g_part.c
==============================================================================
--- user/attilio/vmcontention/sys/geom/part/g_part.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/geom/part/g_part.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -451,6 +451,10 @@ g_part_parm_geom(struct gctl_req *req, c
 		gctl_error(req, "%d %s '%s'", EINVAL, name, gname);
 		return (EINVAL);
 	}
+	if ((gp->flags & G_GEOM_WITHER) != 0) {
+		gctl_error(req, "%d %s", ENXIO, gname);
+		return (ENXIO);
+	}
 	*v = gp;
 	return (0);
 }

Modified: user/attilio/vmcontention/sys/kern/kern_sig.c
==============================================================================
--- user/attilio/vmcontention/sys/kern/kern_sig.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/kern/kern_sig.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -2058,7 +2058,7 @@ tdsendsignal(struct proc *p, struct thre
 	 */
 	mtx_lock(&ps->ps_mtx);
 	if (SIGISMEMBER(ps->ps_sigignore, sig)) {
-		SDT_PROBE(proc, kernel, , signal_discard, ps, td, sig, 0, 0 );
+		SDT_PROBE(proc, kernel, , signal_discard, td, p, sig, 0, 0 );
 
 		mtx_unlock(&ps->ps_mtx);
 		if (ksi && (ksi->ksi_flags & KSI_INS))

Modified: user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c
==============================================================================
--- user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/net80211/ieee80211_freebsd.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -571,8 +571,8 @@ ieee80211_notify_replay_failure(struct i
 	struct ifnet *ifp = vap->iv_ifp;
 
 	IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_CRYPTO, wh->i_addr2,
-	    "%s replay detected <rsc %ju, csc %ju, keyix %u rxkeyix %u>",
-	    k->wk_cipher->ic_name, (intmax_t) rsc,
+	    "%s replay detected tid %d <rsc %ju, csc %ju, keyix %u rxkeyix %u>",
+	    tid, k->wk_cipher->ic_name, (intmax_t) rsc,
 	    (intmax_t) k->wk_keyrsc[tid],
 	    k->wk_keyix, k->wk_rxkeyix);
 

Modified: user/attilio/vmcontention/sys/vm/vm_contig.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_contig.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_contig.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -335,12 +335,12 @@ contigmapping(vm_map_t map, vm_size_t si
 
 vm_offset_t
 kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags, vm_paddr_t low,
-    vm_paddr_t high, unsigned long alignment, unsigned long boundary,
+    vm_paddr_t high, u_long alignment, vm_paddr_t boundary,
     vm_memattr_t memattr)
 {
 	vm_offset_t ret;
 	vm_page_t pages;
-	unsigned long npgs;
+	u_long npgs;
 	int tries;
 
 	size = round_page(size);

Modified: user/attilio/vmcontention/sys/vm/vm_extern.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_extern.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_extern.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -44,8 +44,8 @@ vm_offset_t kmem_alloc(vm_map_t, vm_size
 vm_offset_t kmem_alloc_attr(vm_map_t map, vm_size_t size, int flags,
     vm_paddr_t low, vm_paddr_t high, vm_memattr_t memattr);
 vm_offset_t kmem_alloc_contig(vm_map_t map, vm_size_t size, int flags,
-    vm_paddr_t low, vm_paddr_t high, unsigned long alignment,
-    unsigned long boundary, vm_memattr_t memattr);
+    vm_paddr_t low, vm_paddr_t high, u_long alignment, vm_paddr_t boundary,
+    vm_memattr_t memattr);
 vm_offset_t kmem_alloc_nofault(vm_map_t, vm_size_t);
 vm_offset_t kmem_alloc_nofault_space(vm_map_t, vm_size_t, int);
 vm_offset_t kmem_alloc_wait(vm_map_t, vm_size_t);

Modified: user/attilio/vmcontention/sys/vm/vm_phys.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_phys.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_phys.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -490,26 +490,6 @@ vm_phys_alloc_freelist_pages(int flind, 
 }
 
 /*
- * Allocate physical memory from phys_avail[].
- */
-vm_paddr_t
-vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment)
-{
-	vm_paddr_t pa;
-	int i;
-
-	size = round_page(size);
-	for (i = 0; phys_avail[i + 1] != 0; i += 2) {
-		if (phys_avail[i + 1] - phys_avail[i] < size)
-			continue;
-		pa = phys_avail[i];
-		phys_avail[i] += size;
-		return (pa);
-	}
-	panic("vm_phys_bootstrap_alloc");
-}
-
-/*
  * Find the vm_page corresponding to the given physical address.
  */
 vm_page_t
@@ -554,7 +534,7 @@ vm_phys_free_pages(vm_page_t m, int orde
 {
 	struct vm_freelist *fl;
 	struct vm_phys_seg *seg;
-	vm_paddr_t pa, pa_buddy;
+	vm_paddr_t pa;
 	vm_page_t m_buddy;
 
 	KASSERT(m->order == VM_NFREEORDER,
@@ -566,25 +546,26 @@ vm_phys_free_pages(vm_page_t m, int orde
 	KASSERT(order < VM_NFREEORDER,
 	    ("vm_phys_free_pages: order %d is out of range", order));
 	mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
-	pa = VM_PAGE_TO_PHYS(m);
 	seg = &vm_phys_segs[m->segind];
-	while (order < VM_NFREEORDER - 1) {
-		pa_buddy = pa ^ (1 << (PAGE_SHIFT + order));
-		if (pa_buddy < seg->start ||
-		    pa_buddy >= seg->end)
-			break;
-		m_buddy = &seg->first_page[atop(pa_buddy - seg->start)];
-		if (m_buddy->order != order)
-			break;
-		fl = (*seg->free_queues)[m_buddy->pool];
-		TAILQ_REMOVE(&fl[m_buddy->order].pl, m_buddy, pageq);
-		fl[m_buddy->order].lcnt--;
-		m_buddy->order = VM_NFREEORDER;
-		if (m_buddy->pool != m->pool)
-			vm_phys_set_pool(m->pool, m_buddy, order);
-		order++;
-		pa &= ~((1 << (PAGE_SHIFT + order)) - 1);
-		m = &seg->first_page[atop(pa - seg->start)];
+	if (order < VM_NFREEORDER - 1) {
+		pa = VM_PAGE_TO_PHYS(m);
+		do {
+			pa ^= ((vm_paddr_t)1 << (PAGE_SHIFT + order));
+			if (pa < seg->start || pa >= seg->end)
+				break;
+			m_buddy = &seg->first_page[atop(pa - seg->start)];
+			if (m_buddy->order != order)
+				break;
+			fl = (*seg->free_queues)[m_buddy->pool];
+			TAILQ_REMOVE(&fl[order].pl, m_buddy, pageq);
+			fl[order].lcnt--;
+			m_buddy->order = VM_NFREEORDER;
+			if (m_buddy->pool != m->pool)
+				vm_phys_set_pool(m->pool, m_buddy, order);
+			order++;
+			pa &= ~(((vm_paddr_t)1 << (PAGE_SHIFT + order)) - 1);
+			m = &seg->first_page[atop(pa - seg->start)];
+		} while (order < VM_NFREEORDER - 1);
 	}
 	m->order = order;
 	fl = (*seg->free_queues)[m->pool];
@@ -593,6 +574,47 @@ vm_phys_free_pages(vm_page_t m, int orde
 }
 
 /*
+ * Free a contiguous, arbitrarily sized set of physical pages.
+ *
+ * The free page queues must be locked.
+ */
+void
+vm_phys_free_contig(vm_page_t m, u_long npages)
+{
+	u_int n;
+	int order;
+
+	/*
+	 * Avoid unnecessary coalescing by freeing the pages in the largest
+	 * possible power-of-two-sized subsets.
+	 */
+	mtx_assert(&vm_page_queue_free_mtx, MA_OWNED);
+	for (;; npages -= n) {
+		/*
+		 * Unsigned "min" is used here so that "order" is assigned
+		 * "VM_NFREEORDER - 1" when "m"'s physical address is zero
+		 * or the low-order bits of its physical address are zero
+		 * because the size of a physical address exceeds the size of
+		 * a long.
+		 */
+		order = min(ffsl(VM_PAGE_TO_PHYS(m) >> PAGE_SHIFT) - 1,
+		    VM_NFREEORDER - 1);
+		n = 1 << order;
+		if (npages < n)
+			break;
+		vm_phys_free_pages(m, order);
+		m += n;
+	}
+	/* The residual "npages" is less than "1 << (VM_NFREEORDER - 1)". */
+	for (; npages > 0; npages -= n) {
+		order = flsl(npages) - 1;
+		n = 1 << order;
+		vm_phys_free_pages(m, order);
+		m += n;
+	}
+}
+
+/*
  * Set the pool for a contiguous, power of two-sized set of physical pages. 
  */
 void
@@ -728,14 +750,15 @@ vm_phys_zero_pages_idle(void)
  * "alignment" and "boundary" must be a power of two.
  */
 vm_page_t
-vm_phys_alloc_contig(unsigned long npages, vm_paddr_t low, vm_paddr_t high,
-    unsigned long alignment, unsigned long boundary)
+vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
+    u_long alignment, vm_paddr_t boundary)
 {
 	struct vm_freelist *fl;
 	struct vm_phys_seg *seg;
 	struct vnode *vp;
 	vm_paddr_t pa, pa_last, size;
 	vm_page_t deferred_vdrop_list, m, m_ret;
+	u_long npages_end;
 	int domain, flind, i, oind, order, pind;
 
 #if VM_NDOMAIN > 1
@@ -848,13 +871,10 @@ done:
 			deferred_vdrop_list = m;
 		}
 	}
-	for (; i < roundup2(npages, 1 << imin(oind, order)); i++) {
-		m = &m_ret[i];
-		KASSERT(m->order == VM_NFREEORDER,
-		    ("vm_phys_alloc_contig: page %p has unexpected order %d",
-		    m, m->order));
-		vm_phys_free_pages(m, 0);
-	}
+	/* Return excess pages to the free lists. */
+	npages_end = roundup2(npages, 1 << imin(oind, order));
+	if (npages < npages_end)
+		vm_phys_free_contig(&m_ret[npages], npages_end - npages);
 	mtx_unlock(&vm_page_queue_free_mtx);
 	while (deferred_vdrop_list != NULL) {
 		vdrop((struct vnode *)deferred_vdrop_list->pageq.tqe_prev);

Modified: user/attilio/vmcontention/sys/vm/vm_phys.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_phys.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_phys.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -50,12 +50,11 @@ struct mem_affinity {
 extern struct mem_affinity *mem_affinity;
 
 void vm_phys_add_page(vm_paddr_t pa);
-vm_page_t vm_phys_alloc_contig(unsigned long npages,
-    vm_paddr_t low, vm_paddr_t high,
-    unsigned long alignment, unsigned long boundary);
+vm_page_t vm_phys_alloc_contig(u_long npages, vm_paddr_t low, vm_paddr_t high,
+    u_long alignment, vm_paddr_t boundary);
 vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order);
 vm_page_t vm_phys_alloc_pages(int pool, int order);
-vm_paddr_t vm_phys_bootstrap_alloc(vm_size_t size, unsigned long alignment);
+void vm_phys_free_contig(vm_page_t m, u_long npages);
 void vm_phys_free_pages(vm_page_t m, int order);
 void vm_phys_init(void);
 void vm_phys_set_pool(int pool, vm_page_t m, int order);

Modified: user/attilio/vmcontention/sys/vm/vm_reserv.c
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_reserv.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_reserv.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -616,7 +616,7 @@ vm_reserv_reclaim_inactive(void)
  */
 boolean_t
 vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low, vm_paddr_t high,
-    unsigned long alignment, unsigned long boundary)
+    u_long alignment, vm_paddr_t boundary)
 {
 	vm_paddr_t pa, pa_length;
 	vm_reserv_t rv;

Modified: user/attilio/vmcontention/sys/vm/vm_reserv.h
==============================================================================
--- user/attilio/vmcontention/sys/vm/vm_reserv.h	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/sys/vm/vm_reserv.h	Sun Oct 30 11:43:12 2011	(r226932)
@@ -49,8 +49,7 @@ void		vm_reserv_init(void);
 int		vm_reserv_level_iffullpop(vm_page_t m);
 boolean_t	vm_reserv_reactivate_page(vm_page_t m);
 boolean_t	vm_reserv_reclaim_contig(vm_paddr_t size, vm_paddr_t low,
-		    vm_paddr_t high, unsigned long alignment,
-		    unsigned long boundary);
+		    vm_paddr_t high, u_long alignment, vm_paddr_t boundary);
 boolean_t	vm_reserv_reclaim_inactive(void);
 void		vm_reserv_rename(vm_page_t m, vm_object_t new_object,
 		    vm_object_t old_object, vm_pindex_t old_object_offset);

Copied: user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0 (from r226931, head/tools/regression/bin/sh/builtins/for1.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ user/attilio/vmcontention/tools/regression/bin/sh/builtins/for1.0	Sun Oct 30 11:43:12 2011	(r226932, copy of r226931, head/tools/regression/bin/sh/builtins/for1.0)
@@ -0,0 +1,4 @@
+# $FreeBSD$
+
+false
+for i in `false`; do exit 3; done

Modified: user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday
==============================================================================
--- user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.birthday	Sun Oct 30 11:43:12 2011	(r226932)
@@ -42,6 +42,7 @@
 01/30	Franklin Delano Roosevelt born in Hyde Park, New York, 1882
 01/31	Jackie Robinson born, 1919
 02/03	Gertrude Stein born, 1874
+02/04	Ken Thompson, creator of unix, born, 1943
 02/05	Alex Harvey (SAHB) is born in Glasgow, Scotland, 1935
 02/06	King George VI of UK dies;  his daughter becomes Elizabeth II, 1952
 02/07	Sinclair Lewis born, 1885
@@ -68,6 +69,7 @@
 02/22	Pierre Jules Cesar Janssen born, 1838, found hydrogen in the sun
 02/23	W.E.B. DuBois born, 1868
 02/24	Winslow Homer born, 1836
+02/24	Steve Jobs born, 1955
 02/25	George Harrison born in Liverpool, England, 1943
 02/25	Renoir born, 1841
 02/26	Dominique Francois Jean Arago born, 1786;
@@ -212,7 +214,7 @@
 09/08	Richard ``the Lionheart'', king of England born in Oxford, 1157
 09/08	Peter Sellers born in Southsea, England, 1925
 09/09	Chinese Communist Party Chairman Mao Tse-Tung dies at age 82, 1976
-09/09	Dennis Ritchie born, 1941
+09/09	Dennis MacAlistair Ritchie, creater of C, born, 1941
 09/12	Jesse Owens born, 1913
 09/13	Walter Reed born, 1851
 09/15	Agatha Christie born in Torquay, England, 1890
@@ -239,6 +241,8 @@
 10/02	Mohandas K. Gandhi born at Porbandar, Kathiawad, India, 1869
 10/04	John V. Atanasoff born, 1903
 10/05	Ray Kroc (founder of McDonald's) born, 1902
+10/05	Steve Jobs died at the age of 56, 2011
+10/12	Dennis MacAlistair Ritchie died at the age of 70, 2011
 10/13	Lenny Bruce is born in New York City, 1925
 10/13	Virgil (Publius Vergilius Maro) born near Mantua, Italy, 70 BC
 10/14	Dwight David Eisenhower, 34th President of the United States, born in

Modified: user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/usr.bin/calendar/calendars/calendar.freebsd	Sun Oct 30 11:43:12 2011	(r226932)
@@ -109,6 +109,7 @@
 03/28	Sean C. Farley <scf at FreeBSD.org> born in Indianapolis, Indiana, United States, 1970
 03/29	Thierry Thomas <thierry at FreeBSD.org> born in Luxeuil les Bains, France, 1961
 03/30	Po-Chuan Hsieh <sunpoet at FreeBSD.org> born in Taipei, Taiwan, Republic of China, 1978
+03/31	First quarter status reports are due on 04/15
 04/01	Matthew Jacob <mjacob at FreeBSD.org> born in San Francisco, California, United States, 1958
 04/01	Bill Fenner <fenner at FreeBSD.org> born in Bellefonte, Pennsylvania, United States, 1971
 04/01	Peter Edwards <peadar at FreeBSD.org> born in Dublin, Ireland, 1973
@@ -199,6 +200,7 @@
 06/29	Daniel Harris <dannyboy at FreeBSD.org> born in Lubbock, Texas, United States, 1985
 06/29	Andrew Pantyukhin <sat at FreeBSD.org> born in Moscow, Russian Federation, 1985
 06/30	Guido van Rooij <guido at FreeBSD.org> born in Best, Noord-Brabant, the Netherlands, 1965
+06/30	Second quarter status reports are due on 07/15
 07/01	Matthew Dillon <dillon at apollo.backplane.net> born in San Francisco, California, United States, 1966
 07/02	Mark Christopher Ovens <marko at FreeBSD.org> born in Preston, Lancashire, United Kingdom, 1958
 07/02	Vasil Venelinov Dimov <vd at FreeBSD.org> born in Shumen, Bulgaria, 1982
@@ -282,6 +284,7 @@
 09/28	Alex Dupre <ale at FreeBSD.org> born in Milano, Italy, 1980
 09/29	Matthew Hunt <mph at FreeBSD.org> born in Johnstown, Pennsylvania, United States, 1976
 09/30	Hiten M. Pandya <hmp at FreeBSD.org> born in Dar-es-Salaam, Tanzania, East Africa, 1986
+09/30	Third quarter status reports are due on 10/15
 10/02	Beat Gaetzi <beat at FreeBSD.org> born in Zurich, Switzerland, 1980
 10/05	Hiroki Sato <hrs at FreeBSD.org> born in Yamagata, Japan, 1977
 10/05	Chris Costello <chris at FreeBSD.org> born in Houston, Texas, United States, 1985
@@ -341,5 +344,6 @@
 12/28	Ade Lovett <ade at FreeBSD.org> born in London, England, 1969
 12/28	Marius Strobl <marius at FreeBSD.org> born in Cham, Bavaria, Germany, 1978
 12/31	Edwin Groothuis <edwin at FreeBSD.org> born in Geldrop, the Netherlands, 1970
+12/31	Fourth quarter status reports are due on 01/15
 
 #endif /* !_calendar_freebsd_ */

Modified: user/attilio/vmcontention/usr.bin/sed/sed.1
==============================================================================
--- user/attilio/vmcontention/usr.bin/sed/sed.1	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/usr.bin/sed/sed.1	Sun Oct 30 11:43:12 2011	(r226932)
@@ -343,7 +343,7 @@ can be preceded by white space and can b
 The function can be preceded by white space.
 The terminating
 .Dq }
-must be preceded by a newline or optional white space.
+must be preceded by a newline, and may also be preceded by white space.
 .Pp
 .Bl -tag -width "XXXXXX" -compact
 .It [2addr] function-list

Modified: user/attilio/vmcontention/usr.bin/who/who.1
==============================================================================
--- user/attilio/vmcontention/usr.bin/who/who.1	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/usr.bin/who/who.1	Sun Oct 30 11:43:12 2011	(r226932)
@@ -28,7 +28,7 @@
 .\"     @(#)who.1	8.2 (Berkeley) 12/30/93
 .\" $FreeBSD$
 .\"
-.Dd May 8, 2002
+.Dd Oct 28, 2011
 .Dt WHO 1
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd display who is on the system
 .Sh SYNOPSIS
 .Nm
-.Op Fl HmqsTu
+.Op Fl bHmqsTu
 .Op Cm am I
 .Op Ar file
 .Sh DESCRIPTION
@@ -48,6 +48,8 @@ remote hostname if not local.
 .Pp
 The options are as follows:
 .Bl -tag -width indent
+.It Fl b
+Write the time and date of the last system reboot.
 .It Fl H
 Write column headings above the output.
 .It Fl m

Modified: user/attilio/vmcontention/usr.bin/who/who.c
==============================================================================
--- user/attilio/vmcontention/usr.bin/who/who.c	Sun Oct 30 11:25:44 2011	(r226931)
+++ user/attilio/vmcontention/usr.bin/who/who.c	Sun Oct 30 11:43:12 2011	(r226932)
@@ -48,14 +48,16 @@ __FBSDID("$FreeBSD$");
 #include <utmpx.h>
 
 static void	heading(void);
+static void	boottime(void);
 static void	process_utmp(void);
 static void	quick(void);
-static void	row(struct utmpx *);
+static void	row(const struct utmpx *);
 static int	ttywidth(void);
 static void	usage(void);
 static void	whoami(void);
 
 static int	Hflag;			/* Write column headings */
+static int	bflag;			/* Show date of the last reboot */
 static int	mflag;			/* Show info about current terminal */
 static int	qflag;			/* "Quick" mode */
 static int	sflag;			/* Show name, line, time */
@@ -69,7 +71,7 @@ main(int argc, char *argv[])
 
 	setlocale(LC_TIME, "");
 
-	while ((ch = getopt(argc, argv, "HTmqsu")) != -1) {
+	while ((ch = getopt(argc, argv, "HTbmqsu")) != -1) {
 		switch (ch) {
 		case 'H':		/* Write column headings */
 			Hflag = 1;
@@ -77,6 +79,9 @@ main(int argc, char *argv[])
 		case 'T':		/* Show terminal state */
 			Tflag = 1;
 			break;
+		case 'b':		/* Show date of the last reboot */
+			bflag = 1;
+			break;
 		case 'm':		/* Show info about current terminal */
 			mflag = 1;
 			break;
@@ -121,6 +126,8 @@ main(int argc, char *argv[])
 			heading();
 		if (mflag)
 			whoami();
+		else if (bflag)
+			boottime();
 		else
 			process_utmp();
 	}
@@ -134,7 +141,7 @@ static void
 usage(void)
 {
 
-	fprintf(stderr, "usage: who [-HmqsTu] [am I] [file]\n");
+	fprintf(stderr, "usage: who [-bHmqsTu] [am I] [file]\n");
 	exit(1);
 }
 
@@ -145,14 +152,14 @@ heading(void)
 	printf("%-16s ", "NAME");
 	if (Tflag)
 		printf("S ");
-	printf("%-8s %-12s ", "LINE", "TIME");
+	printf("%-12s %-12s ", "LINE", "TIME");
 	if (uflag)
 		printf("IDLE  ");
 	printf("%-16s\n", "FROM");
 }
 
 static void
-row(struct utmpx *ut)
+row(const struct utmpx *ut)
 {
 	char buf[80], tty[PATH_MAX];
 	struct stat sb;
@@ -178,7 +185,10 @@ row(struct utmpx *ut)
 	printf("%-16s ", ut->ut_user);
 	if (Tflag)
 		printf("%c ", state);
-	printf("%-8s ", ut->ut_line);
+	if (ut->ut_type == BOOT_TIME)
+		printf("%-12s ", "system boot");
+	else
+		printf("%-12s ", ut->ut_line);
 	t = ut->ut_tv.tv_sec;
 	tm = localtime(&t);
 	strftime(buf, sizeof(buf), d_first ? "%e %b %R" : "%b %e %R", tm);
@@ -225,6 +235,17 @@ process_utmp(void)
 }
 
 static void
+boottime(void)
+{
+	struct utmpx u1, *u2;
+
+	u1.ut_type = BOOT_TIME;
+	if ((u2 = getutxid(&u1)) == NULL)
+		return;
+	row(u2);
+}
+
+static void
 quick(void)
 {
 	struct utmpx *utx;


More information about the svn-src-user mailing list