svn commit: r209719 - in user/jmallett/octeon: . bin/sh cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts etc/mtree games/fortune/datfiles gnu/usr.bin/gdb/libgdb include/arpa lib/libc/gmon lib/l...

Juli Mallett jmallett at FreeBSD.org
Tue Jul 6 10:10:37 UTC 2010


Author: jmallett
Date: Tue Jul  6 10:10:35 2010
New Revision: 209719
URL: http://svn.freebsd.org/changeset/base/209719

Log:
  Merge from head.

Added:
  user/jmallett/octeon/share/man/man4/siftr.4
     - copied unchanged from r209718, head/share/man/man4/siftr.4
  user/jmallett/octeon/sys/dev/e1000/e1000_mbx.c
     - copied unchanged from r209718, head/sys/dev/e1000/e1000_mbx.c
  user/jmallett/octeon/sys/dev/e1000/e1000_mbx.h
     - copied unchanged from r209718, head/sys/dev/e1000/e1000_mbx.h
  user/jmallett/octeon/sys/dev/e1000/e1000_vf.c
     - copied unchanged from r209718, head/sys/dev/e1000/e1000_vf.c
  user/jmallett/octeon/sys/dev/e1000/e1000_vf.h
     - copied unchanged from r209718, head/sys/dev/e1000/e1000_vf.h
  user/jmallett/octeon/sys/modules/siftr/
     - copied from r209718, head/sys/modules/siftr/
  user/jmallett/octeon/sys/netinet/siftr.c
     - copied unchanged from r209718, head/sys/netinet/siftr.c
  user/jmallett/octeon/usr.sbin/pc-sysinstall/Makefile.inc
     - copied unchanged from r209718, head/usr.sbin/pc-sysinstall/Makefile.inc
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/list-config.sh
     - copied unchanged from r209718, head/usr.sbin/pc-sysinstall/backend-query/list-config.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh
     - copied unchanged from r209718, head/usr.sbin/pc-sysinstall/backend-query/list-mirrors.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
     - copied unchanged from r209718, head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
Deleted:
  user/jmallett/octeon/sys/powerpc/include/intr.h
Modified:
  user/jmallett/octeon/ObsoleteFiles.inc
  user/jmallett/octeon/bin/sh/expand.c
  user/jmallett/octeon/bin/sh/jobs.c
  user/jmallett/octeon/bin/sh/jobs.h
  user/jmallett/octeon/bin/sh/parser.c
  user/jmallett/octeon/bin/sh/sh.1
  user/jmallett/octeon/etc/mtree/BSD.usr.dist
  user/jmallett/octeon/games/fortune/datfiles/fortunes-o.real
  user/jmallett/octeon/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
  user/jmallett/octeon/include/arpa/inet.h
  user/jmallett/octeon/lib/libc/gmon/gmon.c
  user/jmallett/octeon/lib/libc/net/sctp_recvmsg.3
  user/jmallett/octeon/lib/libc/net/sctp_send.3
  user/jmallett/octeon/lib/libc/net/sctp_sys_calls.c
  user/jmallett/octeon/lib/libc/posix1e/acl_from_text.c
  user/jmallett/octeon/lib/libc/sys/getgroups.2
  user/jmallett/octeon/lib/libfetch/http.c
  user/jmallett/octeon/lib/libthread_db/Symbol.map
  user/jmallett/octeon/lib/libthread_db/libpthread_db.c
  user/jmallett/octeon/lib/libthread_db/libthr_db.c
  user/jmallett/octeon/lib/libthread_db/thread_db.c
  user/jmallett/octeon/lib/libthread_db/thread_db.h
  user/jmallett/octeon/lib/libthread_db/thread_db_int.h
  user/jmallett/octeon/sbin/bsdlabel/bsdlabel.c
  user/jmallett/octeon/sbin/camcontrol/camcontrol.8
  user/jmallett/octeon/sbin/devd/devd.cc
  user/jmallett/octeon/sbin/devd/devd.hh
  user/jmallett/octeon/sbin/fsck_ffs/suj.c
  user/jmallett/octeon/sbin/geom/class/multipath/geom_multipath.c
  user/jmallett/octeon/sbin/mca/mca.c
  user/jmallett/octeon/sbin/reboot/boot_i386.8
  user/jmallett/octeon/share/man/man3/pthread_join.3
  user/jmallett/octeon/share/man/man4/Makefile
  user/jmallett/octeon/share/man/man4/ata.4
  user/jmallett/octeon/share/man/man4/bwi.4
  user/jmallett/octeon/share/man/man9/Makefile
  user/jmallett/octeon/share/man/man9/alloc_unr.9
  user/jmallett/octeon/share/man/man9/style.9
  user/jmallett/octeon/share/man/man9/vm_page_alloc.9
  user/jmallett/octeon/share/misc/committers-doc.dot
  user/jmallett/octeon/sys/amd64/amd64/machdep.c
  user/jmallett/octeon/sys/amd64/ia32/ia32_signal.c
  user/jmallett/octeon/sys/amd64/linux32/linux32_sysent.c
  user/jmallett/octeon/sys/arm/arm/machdep.c
  user/jmallett/octeon/sys/cam/cam_xpt.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_misc.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_proto.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_signal.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_syscall.h
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_syscalls.c
  user/jmallett/octeon/sys/compat/freebsd32/freebsd32_sysent.c
  user/jmallett/octeon/sys/compat/freebsd32/syscalls.master
  user/jmallett/octeon/sys/compat/linux/linux_signal.c
  user/jmallett/octeon/sys/compat/svr4/svr4_proto.h
  user/jmallett/octeon/sys/compat/svr4/svr4_syscall.h
  user/jmallett/octeon/sys/compat/svr4/svr4_syscallnames.c
  user/jmallett/octeon/sys/compat/svr4/svr4_sysent.c
  user/jmallett/octeon/sys/conf/files
  user/jmallett/octeon/sys/dev/ata/ata-all.c
  user/jmallett/octeon/sys/dev/ata/ata-all.h
  user/jmallett/octeon/sys/dev/ata/ata-card.c
  user/jmallett/octeon/sys/dev/ata/ata-disk.c
  user/jmallett/octeon/sys/dev/ath/ath_hal/ar5416/ar5416reg.h
  user/jmallett/octeon/sys/dev/bge/if_bge.c
  user/jmallett/octeon/sys/dev/bwi/if_bwi.c
  user/jmallett/octeon/sys/dev/e1000/e1000_82575.h
  user/jmallett/octeon/sys/dev/e1000/e1000_api.c
  user/jmallett/octeon/sys/dev/e1000/e1000_api.h
  user/jmallett/octeon/sys/dev/e1000/e1000_hw.h
  user/jmallett/octeon/sys/dev/e1000/e1000_regs.h
  user/jmallett/octeon/sys/dev/e1000/if_igb.c
  user/jmallett/octeon/sys/dev/e1000/if_igb.h
  user/jmallett/octeon/sys/dev/ixgbe/ixgbe.c
  user/jmallett/octeon/sys/dev/ixgbe/ixgbe.h
  user/jmallett/octeon/sys/dev/mpt/mpt.c
  user/jmallett/octeon/sys/dev/mpt/mpt.h
  user/jmallett/octeon/sys/dev/mpt/mpt_cam.c
  user/jmallett/octeon/sys/dev/mpt/mpt_pci.c
  user/jmallett/octeon/sys/dev/mpt/mpt_raid.c
  user/jmallett/octeon/sys/geom/part/g_part.c
  user/jmallett/octeon/sys/geom/part/g_part.h
  user/jmallett/octeon/sys/geom/part/g_part_mbr.c
  user/jmallett/octeon/sys/i386/i386/machdep.c
  user/jmallett/octeon/sys/i386/ibcs2/ibcs2_proto.h
  user/jmallett/octeon/sys/i386/ibcs2/ibcs2_syscall.h
  user/jmallett/octeon/sys/i386/ibcs2/ibcs2_sysent.c
  user/jmallett/octeon/sys/i386/linux/linux_sysent.c
  user/jmallett/octeon/sys/ia64/ia64/machdep.c
  user/jmallett/octeon/sys/ia64/ia64/mca.c
  user/jmallett/octeon/sys/ia64/ia64/mp_machdep.c
  user/jmallett/octeon/sys/ia64/include/asm.h
  user/jmallett/octeon/sys/ia64/include/mca.h
  user/jmallett/octeon/sys/ia64/include/profile.h
  user/jmallett/octeon/sys/kern/init_sysent.c
  user/jmallett/octeon/sys/kern/kern_clock.c
  user/jmallett/octeon/sys/kern/kern_context.c
  user/jmallett/octeon/sys/kern/kern_exec.c
  user/jmallett/octeon/sys/kern/kern_exit.c
  user/jmallett/octeon/sys/kern/kern_sig.c
  user/jmallett/octeon/sys/kern/kern_syscalls.c
  user/jmallett/octeon/sys/kern/kern_thr.c
  user/jmallett/octeon/sys/kern/makesyscalls.sh
  user/jmallett/octeon/sys/kern/subr_sleepqueue.c
  user/jmallett/octeon/sys/kern/subr_trap.c
  user/jmallett/octeon/sys/kern/subr_unit.c
  user/jmallett/octeon/sys/kern/sys_generic.c
  user/jmallett/octeon/sys/kern/sys_process.c
  user/jmallett/octeon/sys/kern/sys_socket.c
  user/jmallett/octeon/sys/kern/syscalls.c
  user/jmallett/octeon/sys/kern/syscalls.master
  user/jmallett/octeon/sys/kern/sysv_shm.c
  user/jmallett/octeon/sys/kern/tty.c
  user/jmallett/octeon/sys/kern/uipc_syscalls.c
  user/jmallett/octeon/sys/kern/vfs_bio.c
  user/jmallett/octeon/sys/kern/vfs_vnops.c
  user/jmallett/octeon/sys/mips/include/pte.h
  user/jmallett/octeon/sys/mips/mips/pm_machdep.c
  user/jmallett/octeon/sys/mips/mips/tlb.c
  user/jmallett/octeon/sys/mips/rmi/board.c
  user/jmallett/octeon/sys/mips/rmi/board.h
  user/jmallett/octeon/sys/modules/Makefile
  user/jmallett/octeon/sys/modules/em/Makefile
  user/jmallett/octeon/sys/modules/igb/Makefile
  user/jmallett/octeon/sys/net80211/ieee80211_crypto.h
  user/jmallett/octeon/sys/net80211/ieee80211_crypto_ccmp.c
  user/jmallett/octeon/sys/net80211/ieee80211_crypto_tkip.c
  user/jmallett/octeon/sys/netgraph/ng_ipfw.c
  user/jmallett/octeon/sys/netinet/ipfw/ip_fw2.c
  user/jmallett/octeon/sys/netinet/sctp_pcb.c
  user/jmallett/octeon/sys/netinet/sctputil.c
  user/jmallett/octeon/sys/pc98/pc98/machdep.c
  user/jmallett/octeon/sys/powerpc/aim/clock.c
  user/jmallett/octeon/sys/powerpc/aim/machdep.c
  user/jmallett/octeon/sys/powerpc/booke/clock.c
  user/jmallett/octeon/sys/powerpc/booke/machdep.c
  user/jmallett/octeon/sys/powerpc/include/asm.h
  user/jmallett/octeon/sys/powerpc/include/profile.h
  user/jmallett/octeon/sys/powerpc/mpc85xx/atpic.c
  user/jmallett/octeon/sys/powerpc/mpc85xx/opic.c
  user/jmallett/octeon/sys/powerpc/powermac/cuda.c
  user/jmallett/octeon/sys/powerpc/powermac/hrowpic.c
  user/jmallett/octeon/sys/powerpc/powermac/openpic_macio.c
  user/jmallett/octeon/sys/powerpc/powermac/pmu.c
  user/jmallett/octeon/sys/powerpc/powerpc/intr_machdep.c
  user/jmallett/octeon/sys/powerpc/powerpc/openpic.c
  user/jmallett/octeon/sys/powerpc/psim/openpic_iobus.c
  user/jmallett/octeon/sys/sparc64/include/smp.h
  user/jmallett/octeon/sys/sparc64/sparc64/machdep.c
  user/jmallett/octeon/sys/sun4v/sun4v/machdep.c
  user/jmallett/octeon/sys/sys/diskmbr.h
  user/jmallett/octeon/sys/sys/proc.h
  user/jmallett/octeon/sys/sys/ptrace.h
  user/jmallett/octeon/sys/sys/signalvar.h
  user/jmallett/octeon/sys/sys/syscall.h
  user/jmallett/octeon/sys/sys/syscall.mk
  user/jmallett/octeon/sys/sys/syscallsubr.h
  user/jmallett/octeon/sys/sys/sysent.h
  user/jmallett/octeon/sys/sys/sysproto.h
  user/jmallett/octeon/sys/sys/systm.h
  user/jmallett/octeon/sys/ufs/ffs/ffs_alloc.c
  user/jmallett/octeon/sys/ufs/ffs/ffs_inode.c
  user/jmallett/octeon/sys/ufs/ffs/ffs_softdep.c
  user/jmallett/octeon/sys/ufs/ffs/ffs_vnops.c
  user/jmallett/octeon/sys/ufs/ffs/softdep.h
  user/jmallett/octeon/sys/ufs/ufs/inode.h
  user/jmallett/octeon/sys/ufs/ufs/ufs_inode.c
  user/jmallett/octeon/sys/ufs/ufs/ufs_lookup.c
  user/jmallett/octeon/sys/ufs/ufs/ufs_vnops.c
  user/jmallett/octeon/sys/vm/vm_contig.c
  user/jmallett/octeon/sys/vm/vm_fault.c
  user/jmallett/octeon/sys/vm/vm_map.c
  user/jmallett/octeon/sys/vm/vm_object.c
  user/jmallett/octeon/sys/vm/vm_page.c
  user/jmallett/octeon/sys/vm/vm_page.h
  user/jmallett/octeon/sys/vm/vm_pageout.c
  user/jmallett/octeon/sys/vm/vm_pager.h
  user/jmallett/octeon/sys/x86/isa/atrtc.c
  user/jmallett/octeon/sys/x86/isa/clock.c
  user/jmallett/octeon/tools/regression/bin/sh/expansion/arith2.0
  user/jmallett/octeon/usr.bin/locate/bigram/locate.bigram.c
  user/jmallett/octeon/usr.bin/locate/code/locate.code.c
  user/jmallett/octeon/usr.bin/lock/Makefile
  user/jmallett/octeon/usr.bin/lock/lock.c
  user/jmallett/octeon/usr.bin/ministat/ministat.1
  user/jmallett/octeon/usr.bin/tcopy/Makefile
  user/jmallett/octeon/usr.bin/tcopy/tcopy.c
  user/jmallett/octeon/usr.bin/tftp/tftp.c
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-partmanager/Makefile
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-partmanager/create-part.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-partmanager/delete-part.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/Makefile
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/detect-laptop.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/detect-nics.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/detect-vmware.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/disk-info.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/disk-list.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/disk-part.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/enable-net.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/list-components.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/list-rsync-backups.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/list-tzones.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/query-langs.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/send-logs.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/setup-ssh-keys.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/sys-mem.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/test-live.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/test-netup.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/update-part-list.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/xkeyboard-layouts.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/xkeyboard-models.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend-query/xkeyboard-variants.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/Makefile
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-cleanup.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-disk.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-installcomponents.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-localize.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-mountdisk.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-mountoptical.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-networking.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-newfs.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-parse.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-unmount.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-upgrade.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions-users.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/functions.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/parseconfig.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/backend/startautoinstall.sh
  user/jmallett/octeon/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf
  user/jmallett/octeon/usr.sbin/pc-sysinstall/doc/help-index
  user/jmallett/octeon/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
  user/jmallett/octeon/usr.sbin/wpa/wpa_supplicant/driver_freebsd.c
Directory Properties:
  user/jmallett/octeon/   (props changed)
  user/jmallett/octeon/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl   (props changed)
  user/jmallett/octeon/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl   (props changed)
  user/jmallett/octeon/share/mk/bsd.arch.inc.mk   (props changed)
  user/jmallett/octeon/sys/arm/include/bootinfo.h   (props changed)

Modified: user/jmallett/octeon/ObsoleteFiles.inc
==============================================================================
--- user/jmallett/octeon/ObsoleteFiles.inc	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/ObsoleteFiles.inc	Tue Jul  6 10:10:35 2010	(r209719)
@@ -14,6 +14,10 @@
 # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
 #
 
+# 20100701: [powerpc] removed <machine/intr.h>
+.if ${TARGET_ARCH} == "powerpc"
+OLD_FILES+=usr/include/machine/intr.h
+.endif
 # 20100514: library version bump for versioned symbols for liblzma
 OLD_LIBS+=usr/lib/liblzma.so.0
 .if ${TARGET_ARCH} == "amd64"

Modified: user/jmallett/octeon/bin/sh/expand.c
==============================================================================
--- user/jmallett/octeon/bin/sh/expand.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/bin/sh/expand.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -818,7 +818,7 @@ varisset(char *name, int nulok)
 {
 
 	if (*name == '!')
-		return backgndpid != -1;
+		return backgndpidset();
 	else if (*name == '@' || *name == '*') {
 		if (*shellparam.p == NULL)
 			return 0;
@@ -891,7 +891,7 @@ varvalue(char *name, int quoted, int sub
 		num = shellparam.nparam;
 		goto numvar;
 	case '!':
-		num = backgndpid;
+		num = backgndpidval();
 numvar:
 		expdest = cvtnum(num, expdest);
 		break;

Modified: user/jmallett/octeon/bin/sh/jobs.c
==============================================================================
--- user/jmallett/octeon/bin/sh/jobs.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/bin/sh/jobs.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
 STATIC struct job *jobtab;	/* array of jobs */
 STATIC int njobs;		/* size of array */
 MKINIT pid_t backgndpid = -1;	/* pid of last background process */
+MKINIT struct job *bgjob = NULL; /* last background process */
 #if JOBS
 STATIC struct job *jobmru;	/* most recently used job list */
 STATIC pid_t initialpgrp;	/* pgrp of shell on invocation */
@@ -183,6 +184,7 @@ INCLUDE <stdlib.h>
 
 SHELLPROC {
 	backgndpid = -1;
+	bgjob = NULL;
 #if JOBS
 	jobctl = 0;
 #endif
@@ -413,7 +415,11 @@ showjobs(int change, int mode)
 			continue;
 		showjob(jp, 0, mode);
 		jp->changed = 0;
-		if (jp->state == JOBDONE) {
+		/* Hack: discard jobs for which $! has not been referenced
+		 * in interactive mode when they terminate.
+		 */
+		if (jp->state == JOBDONE && !jp->remembered &&
+				(iflag || jp != bgjob)) {
 			freejob(jp);
 		}
 	}
@@ -431,6 +437,8 @@ freejob(struct job *jp)
 	int i;
 
 	INTOFF;
+	if (bgjob == jp)
+		bgjob = NULL;
 	for (i = jp->nprocs, ps = jp->ps ; --i >= 0 ; ps++) {
 		if (ps->cmd != nullstr)
 			ckfree(ps->cmd);
@@ -477,12 +485,27 @@ waitcmd(int argc, char **argv)
 #endif
 				else
 					retval = WTERMSIG(status) + 128;
-				if (! iflag)
+				if (! iflag || ! job->changed)
 					freejob(job);
+				else {
+					job->remembered = 0;
+					if (job == bgjob)
+						bgjob = NULL;
+				}
 				in_waitcmd--;
 				return retval;
 			}
 		} else {
+			for (jp = jobtab ; jp < jobtab + njobs; jp++)
+				if (jp->used && jp->state == JOBDONE) {
+					if (! iflag || ! jp->changed)
+						freejob(jp);
+					else {
+						jp->remembered = 0;
+						if (jp == bgjob)
+							bgjob = NULL;
+					}
+				}
 			for (jp = jobtab ; ; jp++) {
 				if (jp >= jobtab + njobs) {	/* no running procs */
 					in_waitcmd--;
@@ -623,6 +646,8 @@ makejob(union node *node __unused, int n
 						jp[i].next = &jp[jp[i].next -
 						    jobtab];
 #endif
+				if (bgjob != NULL)
+					bgjob = &jp[bgjob - jobtab];
 				/* Relocate `ps' pointers */
 				for (i = 0; i < njobs; i++)
 					if (jp[i].ps == &jobtab[i].ps0)
@@ -644,6 +669,7 @@ makejob(union node *node __unused, int n
 	jp->changed = 0;
 	jp->nprocs = 0;
 	jp->foreground = 0;
+	jp->remembered = 0;
 #if JOBS
 	jp->jobctl = jobctl;
 	jp->next = NULL;
@@ -821,8 +847,13 @@ forkshell(struct job *jp, union node *n,
 			pgrp = jp->ps[0].pid;
 		setpgid(pid, pgrp);
 	}
-	if (mode == FORK_BG)
+	if (mode == FORK_BG) {
+		if (bgjob != NULL && bgjob->state == JOBDONE &&
+		    !bgjob->remembered && !iflag)
+			freejob(bgjob);
 		backgndpid = pid;		/* set $! */
+		bgjob = jp;
+	}
 	if (jp) {
 		struct procstat *ps = &jp->ps[jp->nprocs++];
 		ps->pid = pid;
@@ -975,10 +1006,15 @@ dowait(int block, struct job *job)
 				if (jp->state != state) {
 					TRACE(("Job %d: changing state from %d to %d\n", jp - jobtab + 1, jp->state, state));
 					jp->state = state;
+					if (jp != job) {
+						if (done && !jp->remembered &&
+						    !iflag && jp != bgjob)
+							freejob(jp);
 #if JOBS
-					if (done)
-						deljob(jp);
+						else if (done)
+							deljob(jp);
 #endif
+					}
 				}
 			}
 		}
@@ -1074,6 +1110,21 @@ checkzombies(void)
 }
 
 
+int
+backgndpidset(void)
+{
+	return backgndpid != -1;
+}
+
+
+pid_t
+backgndpidval(void)
+{
+	if (bgjob != NULL)
+		bgjob->remembered = 1;
+	return backgndpid;
+}
+
 /*
  * Return a string identifying a command (to be printed by the
  * jobs command.

Modified: user/jmallett/octeon/bin/sh/jobs.h
==============================================================================
--- user/jmallett/octeon/bin/sh/jobs.h	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/bin/sh/jobs.h	Tue Jul  6 10:10:35 2010	(r209719)
@@ -68,6 +68,7 @@ struct job {
 	char used;		/* true if this entry is in used */
 	char changed;		/* true if status has changed */
 	char foreground;	/* true if running in the foreground */
+	char remembered;	/* true if $! referenced */
 #if JOBS
 	char jobctl;		/* job running under job control */
 	struct job *next;	/* job used after this one */
@@ -81,7 +82,6 @@ enum {
 	SHOWJOBS_PGIDS		/* PID of the group leader only */
 };
 
-extern pid_t backgndpid;	/* pid of last background process */
 extern int job_warning;		/* user was warned about stopped jobs */
 extern int in_waitcmd;		/* are we in waitcmd()? */
 extern int in_dowait;		/* are we in dowait()? */
@@ -98,6 +98,8 @@ struct job *makejob(union node *, int);
 pid_t forkshell(struct job *, union node *, int);
 int waitforjob(struct job *, int *);
 int stoppedjobs(void);
+int backgndpidset(void);
+pid_t backgndpidval(void);
 char *commandtext(union node *);
 
 #if ! JOBS

Modified: user/jmallett/octeon/bin/sh/parser.c
==============================================================================
--- user/jmallett/octeon/bin/sh/parser.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/bin/sh/parser.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -1734,7 +1734,8 @@ getprompt(void *unused __unused)
 {
 	static char ps[PROMPTLEN];
 	char *fmt;
-	int i, j, trim;
+	const char *pwd;
+	int i, trim;
 	static char internal_error[] = "<internal prompt error>";
 
 	/*
@@ -1785,17 +1786,15 @@ getprompt(void *unused __unused)
 				 */
 			case 'W':
 			case 'w':
-				ps[i] = '\0';
-				getcwd(&ps[i], PROMPTLEN - i);
-				if (*fmt == 'W' && ps[i + 1] != '\0') {
-					/* Final path component only. */
-					trim = 1;
-					for (j = i; ps[j] != '\0'; j++)
-					  if (ps[j] == '/')
-						trim = j + 1;
-					memmove(&ps[i], &ps[trim],
-					    j - trim + 1);
-				}
+				pwd = lookupvar("PWD");
+				if (pwd == NULL)
+					pwd = "?";
+				if (*fmt == 'W' &&
+				    *pwd == '/' && pwd[1] != '\0')
+					strlcpy(&ps[i], strrchr(pwd, '/') + 1,
+					    PROMPTLEN - i);
+				else
+					strlcpy(&ps[i], pwd, PROMPTLEN - i);
 				/* Skip to end of path. */
 				while (ps[i + 1] != '\0')
 					i++;

Modified: user/jmallett/octeon/bin/sh/sh.1
==============================================================================
--- user/jmallett/octeon/bin/sh/sh.1	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/bin/sh/sh.1	Tue Jul  6 10:10:35 2010	(r209719)
@@ -32,7 +32,7 @@
 .\"	from: @(#)sh.1	8.6 (Berkeley) 5/4/95
 .\" $FreeBSD$
 .\"
-.Dd May 24, 2010
+.Dd June 29, 2010
 .Dt SH 1
 .Os
 .Sh NAME
@@ -1106,6 +1106,10 @@ command executed from the current shell.
 For a
 pipeline, the process ID is that of the last command in the
 pipeline.
+If this parameter is referenced, the shell will remember
+the process ID and its exit status until the
+.Ic wait
+built-in command reports completion of the process.
 .It Li $0
 (zero) Expands to the name of the shell or shell script.
 .El

Modified: user/jmallett/octeon/etc/mtree/BSD.usr.dist
==============================================================================
--- user/jmallett/octeon/etc/mtree/BSD.usr.dist	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/etc/mtree/BSD.usr.dist	Tue Jul  6 10:10:35 2010	(r209719)
@@ -1231,15 +1231,15 @@
         pc-sysinstall
             backend
             ..
-	    backend-partmanager
+            backend-partmanager
             ..
-	    backend-query
+            backend-query
             ..
-	    conf
+            conf
                 license
-		..
+                ..
             ..
-	    doc
+            doc
             ..
         ..
         security

Modified: user/jmallett/octeon/games/fortune/datfiles/fortunes-o.real
==============================================================================
--- user/jmallett/octeon/games/fortune/datfiles/fortunes-o.real	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/games/fortune/datfiles/fortunes-o.real	Tue Jul  6 10:10:35 2010	(r209719)
@@ -12433,6 +12433,39 @@ And sure enough she'll take you home and
 	(chorus)
 		-- Crosby, Stills, Nash, "Fair Game"
 %
+Taken from actual police car videos:
+
+(15) Relax!  The handcuffs are tight because they're new.  They'll
+     stretch out after you wear them awhile.
+(14) Take your hands off the car and I'll make your birth certificate
+     a worthless document.
+(13) If you run you'll only go to jail tired.
+(12) Can you run faster than 1200 feet per second?  In case you didn't
+     know that's the average speed of a 9 mm bullet fired from my gun.
+(11) So you don't know how fast you were going.  I guess that means I
+     can write anything I want on the ticket, huh?
+(10) Yes, sir, you can talk to the shift supervisor, but I don't think
+     it will help.  Oh, did I mention that I AM the shift supervisor?
+(9)  Warning? You want a warning?  OK, I'm warning you not to do that
+     again or I'll give you another ticket.
+(8)  The answer to this last question will determine whether you are
+     drunk or not.  Is Mickey Mouse a cat or a dog?
+%
+Taken from actual police car videos:
+
+(7) Fair?  You want me to be fair?  Listen, fair is a place where you
+    go to ride on rides, eat cotton candy, and step in monkey poop.
+(6) Yeah, we have a quota.  Two more tickets and my wife gets a toaster
+    oven.
+(5) No, sir, we don't have quotas anymore.  We used to have quotas but
+    now we're allowed to write as many tickets as we want.
+(4) Just how big were those two beers?
+(3) In God we trust, all others we run through CPIC/NCIC.
+(2) I'm glad to hear the Chief of Police is a good personal friend of
+    yours.  At least you know someone who can post your bail.
+(1) You didn't think we gave pretty women tickets?
+    You're right, we don't -- sign here.
+%
 Taoism: Shit Happens.
 Confucianism: Confucius say, "Shit Happens".
 Buddhism: If shit happens, it isn't really shit.

Modified: user/jmallett/octeon/gnu/usr.bin/gdb/libgdb/fbsd-threads.c
==============================================================================
--- user/jmallett/octeon/gnu/usr.bin/gdb/libgdb/fbsd-threads.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/gnu/usr.bin/gdb/libgdb/fbsd-threads.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -1299,6 +1299,7 @@ fbsd_thread_signal_cmd (char *exp, int f
   td_thrhandle_t th;
   td_thrinfo_t ti;
   td_err_e err;
+  const char *code;
 
   if (!fbsd_thread_active || !IS_THREAD(inferior_ptid))
     return;
@@ -1315,6 +1316,42 @@ fbsd_thread_signal_cmd (char *exp, int f
   fbsd_print_sigset(&ti.ti_sigmask);
   printf_filtered("signal pending:\n");
   fbsd_print_sigset(&ti.ti_pending);
+  if (ti.ti_siginfo.si_signo != 0) {
+   printf_filtered("si_signo %d si_errno %d", ti.ti_siginfo.si_signo,
+     ti.ti_siginfo.si_errno);
+   if (ti.ti_siginfo.si_errno != 0)
+    printf_filtered(" (%s)", strerror(ti.ti_siginfo.si_errno));
+   printf_filtered("\n");
+   switch (ti.ti_siginfo.si_code) {
+   case SI_NOINFO:
+	code = "NOINFO";
+	break;
+    case SI_USER:
+	code = "USER";
+	break;
+    case SI_QUEUE:
+	code = "QUEUE";
+	break;
+    case SI_TIMER:
+	code = "TIMER";
+	break;
+    case SI_ASYNCIO:
+	code = "ASYNCIO";
+	break;
+    case SI_MESGQ:
+	code = "MESGQ";
+	break;
+    case SI_KERNEL:
+	code = "KERNEL";
+	break;
+    default:
+	code = "UNKNOWN";
+	break;
+    }
+    printf_filtered("si_code %s si_pid %d si_uid %d si_status %x si_addr %p\n",
+      code, ti.ti_siginfo.si_pid, ti.ti_siginfo.si_uid, ti.ti_siginfo.si_status,
+      ti.ti_siginfo.si_addr);
+  }
 }
 
 static int

Modified: user/jmallett/octeon/include/arpa/inet.h
==============================================================================
--- user/jmallett/octeon/include/arpa/inet.h	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/include/arpa/inet.h	Tue Jul  6 10:10:35 2010	(r209719)
@@ -58,7 +58,7 @@
 #ifndef _ARPA_INET_H_
 #define	_ARPA_INET_H_
 
-/* External definitions for functions in inet(3), addr2ascii(3) */
+/* External definitions for functions in inet(3). */
 
 #include <sys/cdefs.h>
 #include <sys/_types.h>

Modified: user/jmallett/octeon/lib/libc/gmon/gmon.c
==============================================================================
--- user/jmallett/octeon/lib/libc/gmon/gmon.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/gmon/gmon.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 
 #include <err.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -58,8 +59,8 @@ extern char *minbrk __asm ("minbrk");
 struct gmonparam _gmonparam = { GMON_PROF_OFF };
 
 static int	s_scale;
-/* see profil(2) where this is describe (incorrectly) */
-#define		SCALE_1_TO_1	0x10000L
+/* See profil(2) where this is described (incorrectly). */
+#define	SCALE_SHIFT	16
 
 #define ERR(s) _write(2, s, sizeof(s))
 
@@ -110,24 +111,8 @@ monstartup(lowpc, highpc)
 	p->tos[0].link = 0;
 
 	o = p->highpc - p->lowpc;
-	if (p->kcountsize < o) {
-#ifndef hp300
-		s_scale = ((float)p->kcountsize / o ) * SCALE_1_TO_1;
-#else /* avoid floating point */
-		int quot = o / p->kcountsize;
-
-		if (quot >= 0x10000)
-			s_scale = 1;
-		else if (quot >= 0x100)
-			s_scale = 0x10000 / quot;
-		else if (o >= 0x800000)
-			s_scale = 0x1000000 / (o / (p->kcountsize >> 8));
-		else
-			s_scale = 0x1000000 / ((o << 8) / p->kcountsize);
-#endif
-	} else
-		s_scale = SCALE_1_TO_1;
-
+	s_scale = (p->kcountsize < o) ?
+	    ((uintmax_t)p->kcountsize << SCALE_SHIFT) / o : (1 << SCALE_SHIFT);
 	moncontrol(1);
 }
 

Modified: user/jmallett/octeon/lib/libc/net/sctp_recvmsg.3
==============================================================================
--- user/jmallett/octeon/lib/libc/net/sctp_recvmsg.3	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/net/sctp_recvmsg.3	Tue Jul  6 10:10:35 2010	(r209719)
@@ -146,14 +146,14 @@ The 
 argument is defined as follows.
 .Bd -literal
 struct sctp_sndrcvinfo {
-	u_int16_t sinfo_stream;  /* Stream arriving on */
-	u_int16_t sinfo_ssn;     /* Stream Sequence Number */
-	u_int16_t sinfo_flags;   /* Flags on the incoming message */
-	u_int32_t sinfo_ppid;    /* The ppid field */
-	u_int32_t sinfo_context; /* context field */
-	u_int32_t sinfo_timetolive; /* not used by sctp_recvmsg */
-	u_int32_t sinfo_tsn;        /* The transport sequence number */
-	u_int32_t sinfo_cumtsn;     /* The cumulative acknowledgment point  */
+	uint16_t sinfo_stream;  /* Stream arriving on */
+	uint16_t sinfo_ssn;     /* Stream Sequence Number */
+	uint16_t sinfo_flags;   /* Flags on the incoming message */
+	uint32_t sinfo_ppid;    /* The ppid field */
+	uint32_t sinfo_context; /* context field */
+	uint32_t sinfo_timetolive; /* not used by sctp_recvmsg */
+	uint32_t sinfo_tsn;        /* The transport sequence number */
+	uint32_t sinfo_cumtsn;     /* The cumulative acknowledgment point  */
 	sctp_assoc_t sinfo_assoc_id; /* The association id of the peer */
 };
 .Ed

Modified: user/jmallett/octeon/lib/libc/net/sctp_send.3
==============================================================================
--- user/jmallett/octeon/lib/libc/net/sctp_send.3	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/net/sctp_send.3	Tue Jul  6 10:10:35 2010	(r209719)
@@ -94,14 +94,14 @@ structure is used to control various SCT
 and has the following format:
 .Bd -literal
 struct sctp_sndrcvinfo {
-	u_int16_t sinfo_stream;  /* Stream sending to */
-	u_int16_t sinfo_ssn;     /* valid for recv only */
-	u_int16_t sinfo_flags;   /* flags to control sending */
-	u_int32_t sinfo_ppid;    /* ppid field */
-	u_int32_t sinfo_context; /* context field */
-	u_int32_t sinfo_timetolive; /* timetolive for PR-SCTP */
-	u_int32_t sinfo_tsn;        /* valid for recv only */
-	u_int32_t sinfo_cumtsn;     /* valid for recv only */
+	uint16_t sinfo_stream;  /* Stream sending to */
+	uint16_t sinfo_ssn;     /* valid for recv only */
+	uint16_t sinfo_flags;   /* flags to control sending */
+	uint32_t sinfo_ppid;    /* ppid field */
+	uint32_t sinfo_context; /* context field */
+	uint32_t sinfo_timetolive; /* timetolive for PR-SCTP */
+	uint32_t sinfo_tsn;        /* valid for recv only */
+	uint32_t sinfo_cumtsn;     /* valid for recv only */
 	sctp_assoc_t sinfo_assoc_id; /* The association id */
 };
 .Ed

Modified: user/jmallett/octeon/lib/libc/net/sctp_sys_calls.c
==============================================================================
--- user/jmallett/octeon/lib/libc/net/sctp_sys_calls.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/net/sctp_sys_calls.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -49,9 +49,9 @@ __FBSDID("$FreeBSD$");
 
 #ifndef IN6_IS_ADDR_V4MAPPED
 #define IN6_IS_ADDR_V4MAPPED(a)		      \
-	((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
-	 (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
+	((*(const uint32_t *)(const void *)(&(a)->s6_addr[0]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[4]) == 0) &&	\
+	 (*(const uint32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff)))
 #endif
 
 
@@ -304,7 +304,7 @@ sctp_bindx(int sd, struct sockaddr *addr
 			goto out_error;
 		}
 
-
+		sa = (struct sockaddr *)((caddr_t)sa + sz);
 	}
 	sa = addrs;
 	/*
@@ -533,11 +533,11 @@ sctp_sendmsg(int s,
     size_t len,
     const struct sockaddr *to,
     socklen_t tolen,
-    u_int32_t ppid,
-    u_int32_t flags,
-    u_int16_t stream_no,
-    u_int32_t timetolive,
-    u_int32_t context)
+    uint32_t ppid,
+    uint32_t flags,
+    uint16_t stream_no,
+    uint32_t timetolive,
+    uint32_t context)
 {
 #ifdef SYS_sctp_generic_sendmsg
 	struct sctp_sndrcvinfo sinfo;
@@ -814,11 +814,11 @@ sctp_sendmsgx(int sd,
     size_t len,
     struct sockaddr *addrs,
     int addrcnt,
-    u_int32_t ppid,
-    u_int32_t flags,
-    u_int16_t stream_no,
-    u_int32_t timetolive,
-    u_int32_t context)
+    uint32_t ppid,
+    uint32_t flags,
+    uint16_t stream_no,
+    uint32_t timetolive,
+    uint32_t context)
 {
 	struct sctp_sndrcvinfo sinfo;
 

Modified: user/jmallett/octeon/lib/libc/posix1e/acl_from_text.c
==============================================================================
--- user/jmallett/octeon/lib/libc/posix1e/acl_from_text.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/posix1e/acl_from_text.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -271,9 +271,6 @@ error_label:
  * XXX NOT THREAD SAFE, RELIES ON GETPWNAM, GETGRNAM
  * XXX USES *PW* AND *GR* WHICH ARE STATEFUL AND THEREFORE THIS ROUTINE
  * MAY HAVE SIDE-EFFECTS
- *
- * XXX currently doesn't deal correctly with a numeric uid being passed
- * instead of a username.  What is correct behavior here?  Check chown.
  */
 static int
 _posix1e_acl_name_to_id(acl_tag_t tag, char *name, uid_t *id)

Modified: user/jmallett/octeon/lib/libc/sys/getgroups.2
==============================================================================
--- user/jmallett/octeon/lib/libc/sys/getgroups.2	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libc/sys/getgroups.2	Tue Jul  6 10:10:35 2010	(r209719)
@@ -37,7 +37,7 @@
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
-.In sys/types.h
+.In sys/param.h
 .In unistd.h
 .Ft int
 .Fn getgroups "int gidsetlen" "gid_t *gidset"

Modified: user/jmallett/octeon/lib/libfetch/http.c
==============================================================================
--- user/jmallett/octeon/lib/libfetch/http.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libfetch/http.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -1786,12 +1786,14 @@ http_request(struct url *URL, const char
 			case hdr_www_authenticate:
 				if (conn->err != HTTP_NEED_AUTH)
 					break;
-				http_parse_authenticate(p, &server_challenges);
+				if (http_parse_authenticate(p, &server_challenges))
+					++n;
 				break;
 			case hdr_proxy_authenticate:
 				if (conn->err != HTTP_NEED_PROXY_AUTH)
 					break;
-				http_parse_authenticate(p, &proxy_challenges);
+				if (http_parse_authenticate(p, &proxy_challenges) == 0);
+					++n;
 				break;
 			case hdr_end:
 				/* fall through */

Modified: user/jmallett/octeon/lib/libthread_db/Symbol.map
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/Symbol.map	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/Symbol.map	Tue Jul  6 10:10:35 2010	(r209719)
@@ -19,7 +19,6 @@ FBSD_1.0 {
 	td_thr_dbsuspend;
 	td_thr_event_enable;
 	td_thr_event_getmsg;
-	td_thr_get_info;
 	td_thr_getfpregs;
 	td_thr_getgregs;
 #if defined(i386)
@@ -33,3 +32,7 @@ FBSD_1.0 {
 	td_thr_tls_get_addr;
 	td_thr_validate;
 };
+
+FBSD_1.2 {
+	td_thr_get_info;
+};

Modified: user/jmallett/octeon/lib/libthread_db/libpthread_db.c
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/libpthread_db.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/libpthread_db.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -570,7 +570,7 @@ pt_thr_validate(const td_thrhandle_t *th
 }
 
 static td_err_e
-pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
 {
 	const td_thragent_t *ta = th->th_ta;
 	struct ptrace_lwpinfo linfo;
@@ -659,6 +659,16 @@ pt_thr_get_info(const td_thrhandle_t *th
 	return (0);
 }
 
+static td_err_e
+pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+{
+	td_err_e e;
+
+	e = pt_thr_old_get_info(th, (td_old_thrinfo_t *)info);
+	bzero(&info->ti_siginfo, sizeof(info->ti_siginfo));
+	return (e);
+}
+
 #ifdef __i386__
 static td_err_e
 pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave)
@@ -1114,6 +1124,7 @@ struct ta_ops libpthread_db_ops = {
 	.to_thr_dbsuspend	= pt_thr_dbsuspend,
 	.to_thr_event_enable	= pt_thr_event_enable,
 	.to_thr_event_getmsg	= pt_thr_event_getmsg,
+	.to_thr_old_get_info	= pt_thr_old_get_info,
 	.to_thr_get_info	= pt_thr_get_info,
 	.to_thr_getfpregs	= pt_thr_getfpregs,
 	.to_thr_getgregs	= pt_thr_getgregs,

Modified: user/jmallett/octeon/lib/libthread_db/libthr_db.c
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/libthr_db.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/libthr_db.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -453,7 +453,7 @@ pt_thr_validate(const td_thrhandle_t *th
 }
 
 static td_err_e
-pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+pt_thr_get_info_common(const td_thrhandle_t *th, td_thrinfo_t *info, int old)
 {
 	const td_thragent_t *ta = th->th_ta;
 	struct ptrace_lwpinfo linfo;
@@ -489,6 +489,13 @@ pt_thr_get_info(const td_thrhandle_t *th
 	if (ret == PS_OK) {
 		info->ti_sigmask = linfo.pl_sigmask;
 		info->ti_pending = linfo.pl_siglist;
+		if (!old) {
+			if ((linfo.pl_flags & PL_FLAG_SI) != 0)
+				info->ti_siginfo = linfo.pl_siginfo;
+			else
+				bzero(&info->ti_siginfo,
+				    sizeof(info->ti_siginfo));
+		}
 	} else
 		return (ret);
 	if (state == ta->thread_state_running)
@@ -501,6 +508,20 @@ pt_thr_get_info(const td_thrhandle_t *th
 	return (0);
 }
 
+static td_err_e
+pt_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
+{
+
+	return (pt_thr_get_info_common(th, (td_thrinfo_t *)info, 1));
+}
+
+static td_err_e
+pt_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
+{
+
+	return (pt_thr_get_info_common(th, info, 0));
+}
+
 #ifdef __i386__
 static td_err_e
 pt_thr_getxmmregs(const td_thrhandle_t *th, char *fxsave)
@@ -761,6 +782,7 @@ struct ta_ops libthr_db_ops = {
 	.to_thr_dbsuspend	= pt_thr_dbsuspend,
 	.to_thr_event_enable	= pt_thr_event_enable,
 	.to_thr_event_getmsg	= pt_thr_event_getmsg,
+	.to_thr_old_get_info	= pt_thr_old_get_info,
 	.to_thr_get_info	= pt_thr_get_info,
 	.to_thr_getfpregs	= pt_thr_getfpregs,
 	.to_thr_getgregs	= pt_thr_getgregs,

Modified: user/jmallett/octeon/lib/libthread_db/thread_db.c
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/thread_db.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/thread_db.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -176,6 +176,14 @@ td_thr_event_getmsg(const td_thrhandle_t
 }
 
 td_err_e
+td_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info)
+{
+	const td_thragent_t *ta = th->th_ta;
+	return (ta->ta_ops->to_thr_old_get_info(th, info));
+}
+__sym_compat(td_thr_get_info, td_thr_old_get_info, FBSD_1.0);
+
+td_err_e
 td_thr_get_info(const td_thrhandle_t *th, td_thrinfo_t *info)
 {
 	const td_thragent_t *ta = th->th_ta;

Modified: user/jmallett/octeon/lib/libthread_db/thread_db.h
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/thread_db.h	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/thread_db.h	Tue Jul  6 10:10:35 2010	(r209719)
@@ -191,6 +191,7 @@ typedef struct {
 	psaddr_t	ti_startfunc;
 	psaddr_t	ti_stkbase;
 	size_t		ti_stksize;
+	siginfo_t	ti_siginfo;
 } td_thrinfo_t;
 
 /*

Modified: user/jmallett/octeon/lib/libthread_db/thread_db_int.h
==============================================================================
--- user/jmallett/octeon/lib/libthread_db/thread_db_int.h	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/lib/libthread_db/thread_db_int.h	Tue Jul  6 10:10:35 2010	(r209719)
@@ -32,6 +32,25 @@
 #include <sys/types.h>
 #include <sys/queue.h>
 
+typedef struct {
+	const td_thragent_t *ti_ta_p;
+	thread_t	ti_tid;
+	psaddr_t	ti_thread;
+	td_thr_state_e	ti_state;
+	td_thr_type_e	ti_type;
+	td_thr_events_t	ti_events;
+	int		ti_pri;
+	lwpid_t		ti_lid;
+	char		ti_db_suspended;
+	char		ti_traceme;
+	sigset_t	ti_sigmask;
+	sigset_t	ti_pending;
+	psaddr_t	ti_tls;
+	psaddr_t	ti_startfunc;
+	psaddr_t	ti_stkbase;
+	size_t		ti_stksize;
+} td_old_thrinfo_t;
+
 #define	TD_THRAGENT_FIELDS			\
 	struct ta_ops		*ta_ops;	\
 	TAILQ_ENTRY(td_thragent) ta_next;	\
@@ -65,6 +84,8 @@ struct ta_ops {
 	td_err_e (*to_thr_event_enable)(const td_thrhandle_t *, int);
 	td_err_e (*to_thr_event_getmsg)(const td_thrhandle_t *,
 	    td_event_msg_t *);
+	td_err_e (*to_thr_old_get_info)(const td_thrhandle_t *,
+	    td_old_thrinfo_t *);
 	td_err_e (*to_thr_get_info)(const td_thrhandle_t *, td_thrinfo_t *);
 	td_err_e (*to_thr_getfpregs)(const td_thrhandle_t *, prfpregset_t *);
 	td_err_e (*to_thr_getgregs)(const td_thrhandle_t *, prgregset_t);
@@ -103,4 +124,6 @@ int thr_pwrite_int(const struct td_thrag
 int thr_pwrite_long(const struct td_thragent *, psaddr_t, uint64_t);
 int thr_pwrite_ptr(const struct td_thragent *, psaddr_t, psaddr_t);
 
+td_err_e td_thr_old_get_info(const td_thrhandle_t *th, td_old_thrinfo_t *info);
+
 #endif /* _THREAD_DB_INT_H_ */

Modified: user/jmallett/octeon/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- user/jmallett/octeon/sbin/bsdlabel/bsdlabel.c	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/sbin/bsdlabel/bsdlabel.c	Tue Jul  6 10:10:35 2010	(r209719)
@@ -347,7 +347,7 @@ makelabel(const char *type, struct diskl
 static void
 readboot(void)
 {
-	int fd, i;
+	int fd;
 	struct stat st;
 	uint64_t *p;
 
@@ -358,8 +358,7 @@ readboot(void)
 		err(1, "cannot open %s", xxboot);
 	fstat(fd, &st);
 	if (alphacksum && st.st_size <= BBSIZE - 512) {
-		i = read(fd, bootarea + 512, st.st_size);
-		if (i != st.st_size)
+		if (read(fd, bootarea + 512, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 
 		/*
@@ -372,8 +371,7 @@ readboot(void)
 		p[62] = 0;
 		return;
 	} else if ((!alphacksum) && st.st_size <= BBSIZE) {
-		i = read(fd, bootarea, st.st_size);
-		if (i != st.st_size)
+		if (read(fd, bootarea, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 		return;
 	}
@@ -479,6 +477,7 @@ get_file_parms(int f)
 static int
 readlabel(int flag)
 {
+	ssize_t nbytes;
 	uint32_t lba;
 	int f, i;
 	int error;
@@ -498,8 +497,11 @@ readlabel(int flag)
 		errx(1,
 		    "disks with more than 2^32-1 sectors are not supported");
 	(void)lseek(f, (off_t)0, SEEK_SET);
-	if (read(f, bootarea, BBSIZE) != BBSIZE)
+	nbytes = read(f, bootarea, BBSIZE);
+	if (nbytes == -1)
 		err(4, "%s read", specname);
+	if (nbytes != BBSIZE)
+		errx(4, "couldn't read %d bytes from %s", BBSIZE, specname);
 	close (f);
 	error = bsd_disklabel_le_dec(
 	    bootarea + (labeloffset + labelsoffset * secsize),

Modified: user/jmallett/octeon/sbin/camcontrol/camcontrol.8
==============================================================================
--- user/jmallett/octeon/sbin/camcontrol/camcontrol.8	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/sbin/camcontrol/camcontrol.8	Tue Jul  6 10:10:35 2010	(r209719)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 2, 2010
+.Dd July 1, 2010
 .Dt CAMCONTROL 8
 .Os
 .Sh NAME
@@ -846,11 +846,13 @@ will not be asked about the timeout if a
 command line.
 .El
 .It Ic idle
-Put ATA device into IDLE state. Optional parameter specifies automatic
-idle timer value in seconds.
+Put ATA device into IDLE state. Optional parameter
+.Pq Fl t
+specifies automatic standby timer value in seconds. Value 0 disables timer.
 .It Ic standby
-Put ATA device into STANDBY state. Optional parameter specifies automatic
-standby timer value in seconds.
+Put ATA device into STANDBY state. Optional parameter
+.Pq Fl t
+specifies automatic standby timer value in seconds. Value 0 disables timer.
 .It Ic sleep
 Put ATA device into SLEEP state. Note that the only way get device out of
 this state may be reset.

Modified: user/jmallett/octeon/sbin/devd/devd.cc
==============================================================================
--- user/jmallett/octeon/sbin/devd/devd.cc	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/sbin/devd/devd.cc	Tue Jul  6 10:10:35 2010	(r209719)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2002-2003 M. Warner Losh.
+ * Copyright (c) 2002-2010 M. Warner Losh.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -22,6 +22,35 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ * my_system is a variation on lib/libc/stdlib/system.c:
+ *
+ * Copyright (c) 1988, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
  */
 
 /*
@@ -41,6 +70,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/stat.h>
 #include <sys/sysctl.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <sys/un.h>
 
 #include <ctype.h>
@@ -49,6 +79,7 @@ __FBSDID("$FreeBSD$");
 #include <err.h>
 #include <fcntl.h>
 #include <libutil.h>
+#include <paths.h>
 #include <regex.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -152,13 +183,67 @@ action::~action()
 	// nothing
 }
 
+static int
+my_system(const char *command)
+{
+	pid_t pid, savedpid;
+	int pstat;
+	struct sigaction ign, intact, quitact;
+	sigset_t newsigblock, oldsigblock;
+
+	if (!command)		/* just checking... */
+		return(1);
+
+	/*
+	 * Ignore SIGINT and SIGQUIT, block SIGCHLD. Remember to save
+	 * existing signal dispositions.
+	 */
+	ign.sa_handler = SIG_IGN;
+	::sigemptyset(&ign.sa_mask);
+	ign.sa_flags = 0;
+	::sigaction(SIGINT, &ign, &intact);
+	::sigaction(SIGQUIT, &ign, &quitact);
+	::sigemptyset(&newsigblock);
+	::sigaddset(&newsigblock, SIGCHLD);
+	::sigprocmask(SIG_BLOCK, &newsigblock, &oldsigblock);
+	switch (pid = ::fork()) {
+	case -1:			/* error */
+		break;
+	case 0:				/* child */
+		/*
+		 * Restore original signal dispositions and exec the command.
+		 */
+		::sigaction(SIGINT, &intact, NULL);
+		::sigaction(SIGQUIT,  &quitact, NULL);
+		::sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
+		/*
+		 * Close the PID file, and all other open descriptors.
+		 * Inherit std{in,out,err} only.
+		 */
+		cfg.close_pidfile();
+		::closefrom(3);
+		::execl(_PATH_BSHELL, "sh", "-c", command, (char *)NULL);
+		::_exit(127);
+	default:			/* parent */
+		savedpid = pid;
+		do {
+			pid = ::wait4(savedpid, &pstat, 0, (struct rusage *)0);
+		} while (pid == -1 && errno == EINTR);
+		break;
+	}
+	::sigaction(SIGINT, &intact, NULL);
+	::sigaction(SIGQUIT,  &quitact, NULL);
+	::sigprocmask(SIG_SETMASK, &oldsigblock, NULL);
+	return (pid == -1 ? -1 : pstat);
+}
+
 bool
 action::do_action(config &c)
 {
 	string s = c.expand_string(_cmd);
 	if (Dflag)
 		fprintf(stderr, "Executing '%s'\n", s.c_str());
-	::system(s.c_str());
+	my_system(s.c_str());
 	return (true);
 }
 
@@ -391,6 +476,13 @@ config::write_pidfile()
 }
 
 void
+config::close_pidfile()
+{
+	
+	pidfile_close(pfh);
+}
+
+void
 config::remove_pidfile()
 {
 	

Modified: user/jmallett/octeon/sbin/devd/devd.hh
==============================================================================
--- user/jmallett/octeon/sbin/devd/devd.hh	Tue Jul  6 08:56:34 2010	(r209718)
+++ user/jmallett/octeon/sbin/devd/devd.hh	Tue Jul  6 10:10:35 2010	(r209719)
@@ -153,6 +153,7 @@ public:
 	void set_pidfile(const char *);
 	void reset();
 	void parse();
+	void close_pidfile();

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-user mailing list