svn commit: r211654 - in user/imp/tbemd/usr.bin: . ar c89 c99 calendar calendar/calendars clang clang/clang clang/tblgen col cpio csup du elfdump fstat gcore getopt grep gzip hexdump indent ktrace ...

Warner Losh imp at FreeBSD.org
Sun Aug 22 21:47:20 UTC 2010


Author: imp
Date: Sun Aug 22 21:47:19 2010
New Revision: 211654
URL: http://svn.freebsd.org/changeset/base/211654

Log:
  Merge to head @211636 -- with hand tweaks [given up] hoping for the best

Added:
  user/imp/tbemd/usr.bin/grep/
     - copied from r211636, head/usr.bin/grep/
Modified:
  user/imp/tbemd/usr.bin/Makefile
  user/imp/tbemd/usr.bin/ar/ar.1
  user/imp/tbemd/usr.bin/c89/c89.1
  user/imp/tbemd/usr.bin/c99/c99.1
  user/imp/tbemd/usr.bin/calendar/calendars/calendar.freebsd
  user/imp/tbemd/usr.bin/calendar/locale.c
  user/imp/tbemd/usr.bin/clang/Makefile
  user/imp/tbemd/usr.bin/clang/clang/Makefile
  user/imp/tbemd/usr.bin/clang/tblgen/Makefile
  user/imp/tbemd/usr.bin/col/col.c
  user/imp/tbemd/usr.bin/cpio/bsdcpio.1
  user/imp/tbemd/usr.bin/cpio/cmdline.c
  user/imp/tbemd/usr.bin/cpio/cpio.c
  user/imp/tbemd/usr.bin/cpio/cpio.h
  user/imp/tbemd/usr.bin/csup/csup.1
  user/imp/tbemd/usr.bin/csup/main.c
  user/imp/tbemd/usr.bin/du/du.1
  user/imp/tbemd/usr.bin/du/du.c
  user/imp/tbemd/usr.bin/elfdump/elfdump.c
  user/imp/tbemd/usr.bin/fstat/fstat.1
  user/imp/tbemd/usr.bin/gcore/elfcore.c
  user/imp/tbemd/usr.bin/gcore/extern.h
  user/imp/tbemd/usr.bin/gcore/gcore.1
  user/imp/tbemd/usr.bin/gcore/gcore.c
  user/imp/tbemd/usr.bin/getopt/getopt.1
  user/imp/tbemd/usr.bin/gzip/unpack.c
  user/imp/tbemd/usr.bin/hexdump/od.1
  user/imp/tbemd/usr.bin/indent/indent.c
  user/imp/tbemd/usr.bin/ktrace/ktrace.1
  user/imp/tbemd/usr.bin/locate/bigram/locate.bigram.c
  user/imp/tbemd/usr.bin/locate/code/locate.code.c
  user/imp/tbemd/usr.bin/lock/Makefile
  user/imp/tbemd/usr.bin/lock/lock.c
  user/imp/tbemd/usr.bin/make/str.c
  user/imp/tbemd/usr.bin/ministat/ministat.1
  user/imp/tbemd/usr.bin/netstat/if.c
Directory Properties:
  user/imp/tbemd/usr.bin/csup/   (props changed)

Modified: user/imp/tbemd/usr.bin/Makefile
==============================================================================
--- user/imp/tbemd/usr.bin/Makefile	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/Makefile	Sun Aug 22 21:47:19 2010	(r211654)
@@ -5,7 +5,7 @@
 
 # XXX MISSING:		deroff diction graph learn plot
 #			spell spline struct xsend
-# XXX Use GNU versions: apropos diff grep ld man patch whatis
+# XXX Use GNU versions: apropos diff ld man patch whatis
 # Moved to secure: bdes
 #
 
@@ -57,6 +57,7 @@ SUBDIR=	alias \
 	getconf \
 	getent \
 	getopt \
+	${_grep} \
 	gzip \
 	head \
 	hexdump \
@@ -229,6 +230,10 @@ SUBDIR+=	calendar
 _clang=		clang
 .endif
 
+.if ${MK_GNU_GREP} != "yes"
+_grep=		grep
+.endif
+
 .if ${MK_HESIOD} != "no"
 SUBDIR+=	hesinfo
 .endif

Modified: user/imp/tbemd/usr.bin/ar/ar.1
==============================================================================
--- user/imp/tbemd/usr.bin/ar/ar.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/ar/ar.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -292,7 +292,7 @@ or
 options,
 .Nm
 gives a file-by-file description of the archive modification being
-performed, which consists of three white-space seperated fields:
+performed, which consists of three white-space separated fields:
 the option letter, a dash
 .Dq "-" ,
 and the file name.

Modified: user/imp/tbemd/usr.bin/c89/c89.1
==============================================================================
--- user/imp/tbemd/usr.bin/c89/c89.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/c89/c89.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -94,7 +94,7 @@ absolute pathnames to look in the direct
 pathname before looking in the usual places.
 Thus, headers whose
 names are enclosed in double-quotes
-.Pq Qq
+.Pq Qq \&
 will be searched for first
 in the directory of the file with the
 .Ic #include
@@ -103,7 +103,7 @@ directories named in
 .Fl I
 options, and last in the usual places.
 For headers whose names are enclosed in angle brackets
-.Pq Aq ,
+.Pq Aq \& ,
 the header
 will be searched for only in directories named in
 .Fl I

Modified: user/imp/tbemd/usr.bin/c99/c99.1
==============================================================================
--- user/imp/tbemd/usr.bin/c99/c99.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/c99/c99.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -26,7 +26,7 @@
 .\" From FreeBSD: src/usr.bin/c89/c89.1,v 1.11 2007/03/10 07:10:01 ru Exp
 .\" $FreeBSD$
 .\"
-.Dd October 7, 2002
+.Dd June 17, 2010
 .Dt C99 1
 .Os
 .Sh NAME
@@ -96,7 +96,7 @@ absolute pathnames to look in the direct
 pathname before looking in the usual places.
 Thus, headers whose
 names are enclosed in double-quotes
-.Pq Qq
+.Pq Qq \&
 will be searched for first
 in the directory of the file with the
 .Ic #include
@@ -105,7 +105,7 @@ directories named in
 .Fl I
 options, and last in the usual places.
 For headers whose names are enclosed in angle brackets
-.Pq Aq ,
+.Pq Aq \& ,
 the header
 will be searched for only in directories named in
 .Fl I
@@ -181,7 +181,8 @@ operand is significant.
 .Sh SEE ALSO
 .Xr ar 1 ,
 .Xr c89 1 ,
-.Xr cc 1
+.Xr cc 1 ,
+.Xr c99 7
 .Sh STANDARDS
 The
 .Nm
@@ -195,4 +196,4 @@ features that
 .Tn GCC
 actually implements.
 See
-.Pa http://gcc.gnu.org/gcc-3.3/c99status.html .
+.Pa http://gcc.gnu.org/gcc-4.2/c99status.html .

Modified: user/imp/tbemd/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- user/imp/tbemd/usr.bin/calendar/calendars/calendar.freebsd	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/calendar/calendars/calendar.freebsd	Sun Aug 22 21:47:19 2010	(r211654)
@@ -72,6 +72,7 @@
 03/03	Doug White <dwhite at FreeBSD.org> born in Eugene, Oregon, United States, 1977
 03/03	Gordon Tetlow <gordon at FreeBSD.org> born in Reno, Nevada, United States, 1978
 03/04	Oleksandr Tymoshenko <gonzo at FreeBSD.org> born in Chernihiv, Ukraine, 1980
+03/05	Baptiste Daroussin <bapt at FreeBSD.org> born in Beauvais, France, 1980
 03/05	Philip Paeps <philip at FreeBSD.org> born in Leuven, Belgium, 1983
 03/05	Ulf Lilleengen <lulf at FreeBSD.org> born in Hamar, Norway, 1985
 03/06	Christopher Piazza <cpiazza at FreeBSD.org> born in Kamloops, British Columbia, Canada, 1981
@@ -92,6 +93,7 @@
 03/20	MANTANI Nobutaka <nobutaka at FreeBSD.org> born in Hiroshima, Japan, 1978
 03/20	Cameron Grant <cg at FreeBSD.org> died in Hemel Hempstead, United Kingdom, 2005
 03/20	Henrik Brix Andersen <brix at FreeBSD.org> born in Aarhus, Denmark, 1978
+03/20	Joseph S. Atkinson <jsa at FreeBSD.org> born in Batesville, Arkansas, United States, 1977
 03/22	Brad Davis <brd at FreeBSD.org> born in Farmington, New Mexico, United States, 1983
 03/23	Daniel C. Sobral <dcs at FreeBSD.org> born in Brasilia, Distrito Federal, Brazil, 1971
 03/23	Benno Rice <benno at FreeBSD.org> born in Adelaide, South Australia, Australia, 1977
@@ -288,6 +290,7 @@
 11/10	Gregory Neil Shapiro <gshapiro at FreeBSD.org> born in Providence, Rhode Island, United States, 1970
 11/13	John Baldwin <jhb at FreeBSD.org> born in Stuart, Virginia, United States, 1977
 11/15	Lars Engels <lme at FreeBSD.org> born in Hilden, Nordrhein-Westfalen, Germany, 1980
+11/15	Tijl Coosemans <tijl at FreeBSD.org> born in Duffel, Belgium, 1983
 11/16	Jose Maria Alcaide Salinas <jmas at FreeBSD.org> born in Madrid, Spain, 1962
 11/17	Ralf S. Engelschall <rse at FreeBSD.org> born in Dachau, Bavaria, Germany, 1972
 11/18	Thomas Quinot <thomas at FreeBSD.org> born in Paris, France, 1977

Modified: user/imp/tbemd/usr.bin/calendar/locale.c
==============================================================================
--- user/imp/tbemd/usr.bin/calendar/locale.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/calendar/locale.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -76,7 +76,7 @@ setnnames(void)
 	int i, l;
 	struct tm tm;
 
-	memset(&tm, '\0', sizeof(struct tm));
+	memset(&tm, 0, sizeof(struct tm));
 	for (i = 0; i < 7; i++) {
 		tm.tm_wday = i;
 		strftime(buf, sizeof(buf), "%a", &tm);
@@ -104,7 +104,7 @@ setnnames(void)
 		fndays[i].len = strlen(buf);
 	}
 
-	memset(&tm, '\0', sizeof(struct tm));
+	memset(&tm, 0, sizeof(struct tm));
 	for (i = 0; i < 12; i++) {
 		tm.tm_mon = i;
 		strftime(buf, sizeof(buf), "%b", &tm);

Modified: user/imp/tbemd/usr.bin/clang/Makefile
==============================================================================
--- user/imp/tbemd/usr.bin/clang/Makefile	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/clang/Makefile	Sun Aug 22 21:47:19 2010	(r211654)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR=	clang
+SUBDIR=	clang tblgen
 
 .include <bsd.subdir.mk>

Modified: user/imp/tbemd/usr.bin/clang/clang/Makefile
==============================================================================
--- user/imp/tbemd/usr.bin/clang/clang/Makefile	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/clang/clang/Makefile	Sun Aug 22 21:47:19 2010	(r211654)
@@ -5,24 +5,64 @@
 PROG_CXX=clang
 
 SRCDIR=	tools/clang/tools/driver
-SRCS=	cc1_main.cpp cc1as_main.cpp driver.cpp
+SRCS=	cc1_main.cpp \
+	cc1as_main.cpp \
+	driver.cpp
 MAN=
 
 LINKS=	${BINDIR}/clang ${BINDIR}/clang++
 
-TGHDRS=	CC1AsOptions CC1Options DiagnosticCommonKinds \
-	DiagnosticDriverKinds DiagnosticFrontendKinds \
-	DiagnosticLexKinds DiagnosticSemaKinds Options
-LIBDEPS=clangfrontend clangdriver clangcodegen clangsema clangchecker \
-	clanganalysis clangrewrite clangast clangparse clanglex clangbasic \
-	\
-	llvminstcombine llvmipo llvmbitwriter llvmbitreader \
-	llvmpowerpccodegen llvmpowerpcasmprinter llvmpowerpcinfo \
-	llvmx86asmparser llvmx86asmprinter llvmx86codegen llvmx86info \
-	llvmmipsasmprinter llvmmipscodegen llvmmipsinfo \
-	llvmarmasmparser llvmarmasmprinter llvmarmcodegen \
-	llvmselectiondag llvmasmprinter llvmcodegen llvmscalaropts \
-	llvmtransformutils llvmmc llvmmcparser llvmipa llvmanalysis \
-	llvmtarget llvmmc llvmcore llvmarminfo llvmsupport llvmsystem
+TGHDRS=	CC1AsOptions \
+	CC1Options \
+	DiagnosticCommonKinds \
+	DiagnosticDriverKinds \
+	DiagnosticFrontendKinds \
+	DiagnosticLexKinds \
+	DiagnosticSemaKinds \
+	Options
+LIBDEPS=clangfrontend \
+	clangdriver \
+	clangcodegen \
+	clangsema \
+	clangchecker \
+	clanganalysis \
+	clangrewrite \
+	clangast \
+	clangparse \
+	clanglex \
+	clangbasic \
+	llvminstcombine \
+	llvmipo \
+	llvmbitwriter \
+	llvmbitreader \
+	llvmpowerpccodegen \
+	llvmpowerpcasmprinter \
+	llvmpowerpcinfo \
+	llvmx86asmparser \
+	llvmx86asmprinter \
+	llvmx86codegen \
+	llvmx86info \
+	llvmmipsasmprinter \
+	llvmmipscodegen \
+	llvmmipsinfo \
+	llvmarmasmparser \
+	llvmarmasmprinter \
+	llvmarmcodegen \
+	llvmasmparser \
+	llvmselectiondag \
+	llvmasmprinter \
+	llvmcodegen \
+	llvmscalaropts \
+	llvmtransformutils \
+	llvmmc \
+	llvmmcparser \
+	llvmipa \
+	llvmanalysis \
+	llvmtarget \
+	llvmmc \
+	llvmcore \
+	llvmarminfo \
+	llvmsupport \
+	llvmsystem
 
 .include "../clang.prog.mk"

Modified: user/imp/tbemd/usr.bin/clang/tblgen/Makefile
==============================================================================
--- user/imp/tbemd/usr.bin/clang/tblgen/Makefile	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/clang/tblgen/Makefile	Sun Aug 22 21:47:19 2010	(r211654)
@@ -3,20 +3,44 @@
 PROG_CXX=tblgen
 
 SRCDIR=	utils/TableGen
-SRCS=	ARMDecoderEmitter.cpp AsmMatcherEmitter.cpp \
-	AsmWriterEmitter.cpp AsmWriterInst.cpp CallingConvEmitter.cpp \
-	ClangASTNodesEmitter.cpp ClangDiagnosticsEmitter.cpp \
-	CodeEmitterGen.cpp CodeGenDAGPatterns.cpp \
-	CodeGenInstruction.cpp CodeGenTarget.cpp DAGISelEmitter.cpp \
-	DAGISelMatcher.cpp DAGISelMatcherEmitter.cpp \
-	DAGISelMatcherGen.cpp DAGISelMatcherOpt.cpp \
-	DisassemblerEmitter.cpp EDEmitter.cpp FastISelEmitter.cpp \
-	InstrEnumEmitter.cpp InstrInfoEmitter.cpp IntrinsicEmitter.cpp \
-	LLVMCConfigurationEmitter.cpp OptParserEmitter.cpp Record.cpp \
-	RegisterInfoEmitter.cpp SubtargetEmitter.cpp TGLexer.cpp \
-	TGParser.cpp TGValueTypes.cpp TableGen.cpp TableGenBackend.cpp \
-	X86DisassemblerTables.cpp X86RecognizableInstr.cpp
+SRCS=	ARMDecoderEmitter.cpp \
+	AsmMatcherEmitter.cpp \
+	AsmWriterEmitter.cpp \
+	AsmWriterInst.cpp \
+	CallingConvEmitter.cpp \
+	ClangASTNodesEmitter.cpp \
+	ClangAttrEmitter.cpp \
+	ClangDiagnosticsEmitter.cpp \
+	CodeEmitterGen.cpp \
+	CodeGenDAGPatterns.cpp \
+	CodeGenInstruction.cpp \
+	CodeGenTarget.cpp \
+	DAGISelEmitter.cpp \
+	DAGISelMatcher.cpp \
+	DAGISelMatcherEmitter.cpp \
+	DAGISelMatcherGen.cpp \
+	DAGISelMatcherOpt.cpp \
+	DisassemblerEmitter.cpp \
+	EDEmitter.cpp \
+	FastISelEmitter.cpp \
+	InstrEnumEmitter.cpp \
+	InstrInfoEmitter.cpp \
+	IntrinsicEmitter.cpp \
+	LLVMCConfigurationEmitter.cpp \
+	NeonEmitter.cpp \
+	OptParserEmitter.cpp \
+	Record.cpp \
+	RegisterInfoEmitter.cpp \
+	SubtargetEmitter.cpp \
+	TGLexer.cpp \
+	TGParser.cpp \
+	TGValueTypes.cpp \
+	TableGen.cpp \
+	TableGenBackend.cpp \
+	X86DisassemblerTables.cpp \
+	X86RecognizableInstr.cpp
 MAN=
+LLVM_REQUIRES_EH=
 
 LIBDEPS=llvmsupport llvmsystem
 

Modified: user/imp/tbemd/usr.bin/col/col.c
==============================================================================
--- user/imp/tbemd/usr.bin/col/col.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/col/col.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -461,7 +461,7 @@ flush_line(LINE *l)
 
 			if (compress_spaces && nspace > 1) {
 				while (1) {
-					int tab_col, tab_size;;
+					int tab_col, tab_size;
 
 					tab_col = (last_col + 8) & ~7;
 					if (tab_col > this_col)

Modified: user/imp/tbemd/usr.bin/cpio/bsdcpio.1
==============================================================================
--- user/imp/tbemd/usr.bin/cpio/bsdcpio.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/cpio/bsdcpio.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -295,7 +295,7 @@ for more information.
 .Sh EXAMPLES
 The
 .Nm
-command is traditionally used to copy file heirarchies in conjunction
+command is traditionally used to copy file hierarchies in conjunction
 with the
 .Xr find 1
 command.

Modified: user/imp/tbemd/usr.bin/cpio/cmdline.c
==============================================================================
--- user/imp/tbemd/usr.bin/cpio/cmdline.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/cpio/cmdline.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -285,6 +285,8 @@ cpio_getopt(struct cpio *cpio)
  * A period can be used instead of the colon.
  *
  * Sets uid/gid return as appropriate, -1 indicates uid/gid not specified.
+ * TODO: If the spec uses uname/gname, then return those to the caller
+ * as well.  If the spec provides uid/gid, just return names as NULL.
  *
  * Returns NULL if no error, otherwise returns error string for display.
  *

Modified: user/imp/tbemd/usr.bin/cpio/cpio.c
==============================================================================
--- user/imp/tbemd/usr.bin/cpio/cpio.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/cpio/cpio.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -273,15 +273,21 @@ main(int argc, char *argv[])
 			cpio->quiet = 1;
 			break;
 		case 'R': /* GNU cpio, also --owner */
+			/* TODO: owner_parse should return uname/gname
+			 * also; use that to set [ug]name_override. */
 			errmsg = owner_parse(cpio->optarg, &uid, &gid);
 			if (errmsg) {
 				warnc(-1, "%s", errmsg);
 				usage();
 			}
-			if (uid != -1)
+			if (uid != -1) {
 				cpio->uid_override = uid;
-			if (gid != -1)
+				cpio->uname_override = NULL;
+			}
+			if (gid != -1) {
 				cpio->gid_override = gid;
+				cpio->gname_override = NULL;
+			}
 			break;
 		case 'r': /* POSIX 1997 */
 			cpio->option_rename = 1;
@@ -575,10 +581,14 @@ file_to_archive(struct cpio *cpio, const
 		return (r);
 	}
 
-	if (cpio->uid_override >= 0)
+	if (cpio->uid_override >= 0) {
 		archive_entry_set_uid(entry, cpio->uid_override);
-	if (cpio->gid_override >= 0)
+		archive_entry_set_uname(entry, cpio->uname_override);
+	}
+	if (cpio->gid_override >= 0) {
 		archive_entry_set_gid(entry, cpio->gid_override);
+		archive_entry_set_gname(entry, cpio->gname_override);
+	}
 
 	/*
 	 * Generate a destination path for this entry.

Modified: user/imp/tbemd/usr.bin/cpio/cpio.h
==============================================================================
--- user/imp/tbemd/usr.bin/cpio/cpio.h	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/cpio/cpio.h	Sun Aug 22 21:47:19 2010	(r211654)
@@ -68,7 +68,9 @@ struct cpio {
 	size_t		  pass_destpath_alloc;
 	char		 *pass_destpath;
 	int		  uid_override;
+	char		 *uname_override;
 	int		  gid_override;
+	char		 *gname_override;
 	int		  day_first; /* true if locale prefers day/mon */
 
 	/* If >= 0, then close this when done. */

Modified: user/imp/tbemd/usr.bin/csup/csup.1
==============================================================================
--- user/imp/tbemd/usr.bin/csup/csup.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/csup/csup.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -971,10 +971,6 @@ List files.
 .Xr cvs 1 ,
 .Xr rcsintro 1 ,
 .Xr ssh 1 .
-.Pp
-.Bd -literal
-http://mu.org/~mux/csup.html
-.Ed
 .Sh AUTHORS
 .An -nosplit
 .An Maxime Henrion Aq mux at FreeBSD.org

Modified: user/imp/tbemd/usr.bin/csup/main.c
==============================================================================
--- user/imp/tbemd/usr.bin/csup/main.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/csup/main.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -265,7 +265,6 @@ main(int argc, char *argv[])
 			lprintf(0, "Software version: %s\n", PROTO_SWVER);
 			lprintf(0, "Protocol version: %d.%d\n",
 			    PROTO_MAJ, PROTO_MIN);
-			lprintf(0, "http://mu.org/~mux/csup.html\n");
 			return (0);
 			break;
 		case 'z':

Modified: user/imp/tbemd/usr.bin/du/du.1
==============================================================================
--- user/imp/tbemd/usr.bin/du/du.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/du/du.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -42,7 +42,7 @@
 .Nm
 .Op Fl A
 .Op Fl H | L | P
-.Op Fl a | s | d Ar depth
+.Op Fl a | s | d Ar depth | Fl t Ar threshold
 .Op Fl c
 .Op Fl l
 .Op Fl h | k | m | B Ar blocksize
@@ -72,7 +72,7 @@ This is different from the
 .Fl k, m
 options or setting
 .Ev BLOCKSIZE
-and gives an estimate of how much space the examined file hierachy would
+and gives an estimate of how much space the examined file hierarchy would
 require on a filesystem with the given
 .Ar blocksize .
 Unless in
@@ -107,6 +107,14 @@ This option exists solely for conformanc
 Display an entry for each specified file.
 (Equivalent to
 .Fl d Li 0 )
+.It Fl t Ar threshold
+Display only entries for which size exceeds
+.Ar threshold .
+If
+.Ar threshold
+is negative, display only entries for which size is less than the absolute
+value of
+.Ar threshold .
 .It Fl d Ar depth
 Display an entry for all files and directories
 .Ar depth

Modified: user/imp/tbemd/usr.bin/du/du.c
==============================================================================
--- user/imp/tbemd/usr.bin/du/du.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/du/du.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -90,6 +90,7 @@ main(int argc, char *argv[])
 	FTS		*fts;
 	FTSENT		*p;
 	off_t		savednumber, curblocks;
+	off_t		threshold, threshold_sign;
 	int		ftsoptions;
 	int		listall;
 	int		depth;
@@ -106,12 +107,14 @@ main(int argc, char *argv[])
 	save = argv;
 	ftsoptions = 0;
 	savednumber = 0;
+	threshold = 0;
+	threshold_sign = 1;
 	cblocksize = DEV_BSIZE;
 	blocksize = 0;
 	depth = INT_MAX;
 	SLIST_INIT(&ignores);
 
-	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrx")) != -1)
+	while ((ch = getopt(argc, argv, "AB:HI:LPasd:chklmnrt:x")) != -1)
 		switch (ch) {
 		case 'A':
 			Aflag = 1;
@@ -179,6 +182,14 @@ main(int argc, char *argv[])
 			break;
 		case 'r':		 /* Compatibility. */
 			break;
+		case 't' :
+			if (expand_number(optarg, &threshold) != 0 ||
+			    threshold == 0) {
+				warnx("invalid threshold: %s", optarg);
+				usage();
+			} else if (threshold < 0)
+				threshold_sign = -1;
+			break;
 		case 'x':
 			ftsoptions |= FTS_XDEV;
 			break;
@@ -248,6 +259,10 @@ main(int argc, char *argv[])
 		blocksize /= DEV_BSIZE;
 	}
 
+	if (threshold != 0)
+		threshold = howmany(threshold / DEV_BSIZE * cblocksize,
+		    blocksize);
+
 	rval = 0;
 
 	(void)signal(SIGINFO, siginfo);
@@ -271,7 +286,9 @@ main(int argc, char *argv[])
 			p->fts_parent->fts_bignum += p->fts_bignum +=
 			    curblocks;
 
-			if (p->fts_level <= depth) {
+			if (p->fts_level <= depth && threshold <=
+			    threshold_sign * howmany(p->fts_bignum *
+			    cblocksize, blocksize)) {
 				if (hflag) {
 					prthumanval(p->fts_bignum);
 					(void)printf("\t%s\n", p->fts_path);

Modified: user/imp/tbemd/usr.bin/elfdump/elfdump.c
==============================================================================
--- user/imp/tbemd/usr.bin/elfdump/elfdump.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/elfdump/elfdump.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -322,6 +322,7 @@ sh_types(u_int64_t sht) {
 	case 18: return "SHT_SYMTAB_SHNDX";
 	/* 0x60000000 - 0x6fffffff operating system-specific semantics */
 	case 0x6ffffff0: return "XXX:VERSYM";
+	case 0x6ffffff4: return "SHT_SUNW_dof";
 	case 0x6ffffff7: return "SHT_GNU_LIBLIST";
 	case 0x6ffffffc: return "XXX:VERDEF";
 	case 0x6ffffffd: return "SHT_SUNW(GNU)_verdef";

Modified: user/imp/tbemd/usr.bin/fstat/fstat.1
==============================================================================
--- user/imp/tbemd/usr.bin/fstat/fstat.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/fstat/fstat.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -192,7 +192,7 @@ the name printed may not be the actual
 name that the process originally used to open that file.
 .El
 .Sh SOCKETS
-The formating of open sockets depends on the protocol domain.
+The formatting of open sockets depends on the protocol domain.
 In all cases the first field is the domain name, the second field
 is the socket type (stream, dgram, etc), and the third is the socket
 flags field (in hex).

Modified: user/imp/tbemd/usr.bin/gcore/elfcore.c
==============================================================================
--- user/imp/tbemd/usr.bin/gcore/elfcore.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/gcore/elfcore.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -488,12 +488,17 @@ readmap(pid_t pid)
 		kve = &vmentl[i];
 
 		/*
-		 * Ignore segments of the wrong kind and ones which are not
-		 * readable and writable.
+		 * Ignore 'malformed' segments or ones representing memory
+		 * mapping with MAP_NOCORE on.
+		 * If the 'full' support is disabled, just dump the most
+		 * meaningful data segments.
 		 */
-		if ((kve->kve_protection & KVME_PROT_WRITE) == 0 ||
-		    (kve->kve_protection & KVME_PROT_READ) == 0 ||
-		    (kve->kve_type != KVME_TYPE_DEFAULT &&
+		if ((kve->kve_protection & KVME_PROT_READ) == 0 ||
+		    (kve->kve_flags & KVME_FLAG_NOCOREDUMP) != 0 ||
+		    kve->kve_type == KVME_TYPE_DEAD ||
+		    kve->kve_type == KVME_TYPE_UNKNOWN ||
+		    ((pflags & PFLAGS_FULL) == 0 &&
+		    kve->kve_type != KVME_TYPE_DEFAULT &&
 		    kve->kve_type != KVME_TYPE_VNODE &&
 		    kve->kve_type != KVME_TYPE_SWAP))
 			continue;

Modified: user/imp/tbemd/usr.bin/gcore/extern.h
==============================================================================
--- user/imp/tbemd/usr.bin/gcore/extern.h	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/gcore/extern.h	Sun Aug 22 21:47:19 2010	(r211654)
@@ -34,8 +34,11 @@
  * $FreeBSD$
  */
 
+#define	PFLAGS_FULL	0x01
+#define	PFLAGS_RESUME	0x02
+
 struct dumpers {
 	int (*ident)(int efd, pid_t pid, char *binfile);
 	void (*dump)(int efd, int fd, pid_t pid);
 };
-extern int sflag;
+extern int pflags;

Modified: user/imp/tbemd/usr.bin/gcore/gcore.1
==============================================================================
--- user/imp/tbemd/usr.bin/gcore/gcore.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/gcore/gcore.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -32,7 +32,7 @@
 .\"	@(#)gcore.1	8.2 (Berkeley) 4/18/94
 .\" $FreeBSD$
 .\"
-.Dd November 18, 2009
+.Dd July 14, 2010
 .Dt GCORE 1
 .Os
 .Sh NAME
@@ -40,6 +40,7 @@
 .Nd get core images of running process
 .Sh SYNOPSIS
 .Nm
+.Op Fl f
 .Op Fl s
 .Op Fl c Ar core
 .Op Ar executable
@@ -61,6 +62,13 @@ The following options are available:
 .It Fl c
 Write the core file to the specified file instead of
 .Dq Pa core.<pid> .
+.It Fl f
+Dumps all the available segments, excluding only the malformed ones and
+un-dumpable ones. Unlike the default invocation, it also dumps
+device- and sglist-mapped areas that may invalidate the state of
+some transactions. This flag must be used very carefully, when the
+behavior of the application is fully understood and the fallouts can
+be easily controlled.
 .It Fl s
 Stop the process while gathering the core image, and resume it
 when done.

Modified: user/imp/tbemd/usr.bin/gcore/gcore.c
==============================================================================
--- user/imp/tbemd/usr.bin/gcore/gcore.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/gcore/gcore.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
 #include <unistd.h>
 
 #include "extern.h"
-int sflag;
+int pflags;
 
 static void	killed(int);
 static void	usage(void) __dead2;
@@ -89,15 +89,18 @@ main(int argc, char *argv[])
 	struct dumpers **d, *dumper;
 	size_t len;
 
-	sflag = 0;
+	pflags = 0;
 	corefile = NULL;
-        while ((ch = getopt(argc, argv, "c:s")) != -1) {
+        while ((ch = getopt(argc, argv, "c:fs")) != -1) {
                 switch (ch) {
                 case 'c':
 			corefile = optarg;
                         break;
+		case 'f':
+			pflags |= PFLAGS_FULL;
+			break;
 		case 's':
-			sflag = 1;
+			pflags |= PFLAGS_RESUME;
 			break;
 		default:
 			usage();

Modified: user/imp/tbemd/usr.bin/getopt/getopt.1
==============================================================================
--- user/imp/tbemd/usr.bin/getopt/getopt.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/getopt/getopt.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -1,6 +1,6 @@
 .\" $FreeBSD$
 .\"
-.Dd April 3, 1999
+.Dd July 7, 2010
 .Dt GETOPT 1
 .Os
 .Sh NAME
@@ -64,9 +64,9 @@ set \-\- $args
 # You cannot use the set command with a backquoted getopt directly,
 # since the exit code from getopt would be shadowed by those of set,
 # which is zero by definition.
-for i
+while true;
 do
-	case "$i"
+	case "$1"
 	in
 		\-a|\-b)
 			echo flag $i set; sflags="${i#-}$sflags";

Modified: user/imp/tbemd/usr.bin/gzip/unpack.c
==============================================================================
--- user/imp/tbemd/usr.bin/gzip/unpack.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/gzip/unpack.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -312,7 +312,14 @@ unpack(int in, int out, char *pre, size_
 {
 	unpack_descriptor_t	unpackd;
 
-	unpack_parse_header(dup(in), dup(out), pre, prelen, bytes_in, &unpackd);
+	in = dup(in);
+	if (in == -1)
+		maybe_err("dup");
+	out = dup(out);
+	if (out == -1)
+		maybe_err("dup");
+
+	unpack_parse_header(in, out, pre, prelen, bytes_in, &unpackd);
 	unpack_decode(&unpackd, bytes_in);
 	unpack_descriptor_fini(&unpackd);
 

Modified: user/imp/tbemd/usr.bin/hexdump/od.1
==============================================================================
--- user/imp/tbemd/usr.bin/hexdump/od.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/hexdump/od.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -150,12 +150,12 @@ Named characters
 .Pq Tn ASCII .
 Control characters are displayed using the following names:
 .Bl -column "000 NUL" "001 SOH" "002 STX" "003 ETX" "004 EOT" "005 ENQ"
-.It "000 NUL	001 SOH	002 STX	003 ETX	004 EOT	005 ENQ"
-.It "006 ACK	007 BEL	008 BS	009 HT	00a NL	00b VT"
-.It "00c FF	00d CR	00e SO	00f SI	010 DLE	011 DC1"
-.It "012 DC2	013 DC3	014 DC4	015 NAK	016 SYN	017 ETB"
-.It "018 CAN	019 EM	01a SUB	01b ESC	01c FS	01d GS"
-.It "01e RS	01f US	020 SP	07f DEL"
+.It 000 NUL	001 SOH	002 STX	003 ETX	004 EOT	005 ENQ
+.It 006 ACK	007 BEL	008 BS	009 HT	00A NL	00B VT
+.It 00C FF	00D CR	00E SO	00F SI	010 DLE	011 DC1
+.It 012 DC2	013 DC3	014 DC4	015 NAK	016 SYN	017 ETB
+.It 018 CAN	019 EM	01A SUB	01B ESC	01C FS	01D GS
+.It 01E RS	01F US	020 SP	07F DEL
 .El
 .It Cm c
 Characters in the default character set.

Modified: user/imp/tbemd/usr.bin/indent/indent.c
==============================================================================
--- user/imp/tbemd/usr.bin/indent/indent.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/indent/indent.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -199,21 +199,21 @@ main(int argc, char **argv)
 	 * look thru args (if any) for changes to defaults
 	 */
 	if (argv[i][0] != '-') {/* no flag on parameter */
-	    if (input == 0) {	/* we must have the input file */
+	    if (input == NULL) {	/* we must have the input file */
 		in_name = argv[i];	/* remember name of input file */
 		input = fopen(in_name, "r");
-		if (input == 0)		/* check for open error */
+		if (input == NULL)	/* check for open error */
 			err(1, "%s", in_name);
 		continue;
 	    }
-	    else if (output == 0) {	/* we have the output file */
+	    else if (output == NULL) {	/* we have the output file */
 		out_name = argv[i];	/* remember name of output file */
 		if (strcmp(in_name, out_name) == 0) {	/* attempt to overwrite
 							 * the file */
 		    errx(1, "input and output files must be different");
 		}
 		output = fopen(out_name, "w");
-		if (output == 0)	/* check for create error */
+		if (output == NULL)	/* check for create error */
 			err(1, "%s", out_name);
 		continue;
 	    }
@@ -222,9 +222,9 @@ main(int argc, char **argv)
 	else
 	    set_option(argv[i]);
     }				/* end of for */
-    if (input == 0)
+    if (input == NULL)
 	input = stdin;
-    if (output == 0) {
+    if (output == NULL) {
 	if (troff || input == stdin)
 	    output = stdout;
 	else {
@@ -1223,11 +1223,11 @@ bakcopy(void)
 
     /* re-open backup file as the input file */
     input = fopen(bakfile, "r");
-    if (input == 0)
+    if (input == NULL)
 	err(1, "%s", bakfile);
     /* now the original input file will be the output */
     output = fopen(in_name, "w");
-    if (output == 0) {
+    if (output == NULL) {
 	unlink(bakfile);
 	err(1, "%s", in_name);
     }

Modified: user/imp/tbemd/usr.bin/ktrace/ktrace.1
==============================================================================
--- user/imp/tbemd/usr.bin/ktrace/ktrace.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/ktrace/ktrace.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -112,11 +112,11 @@ The following table equates the letters 
 .Bl -tag -width flag -compact
 .It Cm c
 trace system calls
-.It Cm n
-trace namei translations
 .It Cm i
 trace
 .Tn I/O
+.It Cm n
+trace namei translations
 .It Cm s
 trace signal processing
 .It Cm t
@@ -131,7 +131,7 @@ trace
 requests
 .It Cm +
 trace the default set of trace points -
-.Cm c , n , i , s , t , u
+.Cm c , i , n , s , t , u , y
 .El
 .It Ar command
 Execute

Modified: user/imp/tbemd/usr.bin/locate/bigram/locate.bigram.c
==============================================================================
--- user/imp/tbemd/usr.bin/locate/bigram/locate.bigram.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/locate/bigram/locate.bigram.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -37,6 +37,7 @@
  * $FreeBSD$
  */
 
+#if 0
 #ifndef lint
 static char copyright[] =
 "@(#) Copyright (c) 1989, 1993\n\
@@ -46,6 +47,7 @@ static char copyright[] =
 #ifndef lint
 static char sccsid[] = "@(#)locate.bigram.c	8.1 (Berkeley) 6/6/93";
 #endif /* not lint */
+#endif
 
 /*
  *  bigram < sorted_file_names | sort -nr | 
@@ -67,9 +69,9 @@ u_int bigram[UCHAR_MAX + 1][UCHAR_MAX + 
 int
 main(void)
 {
-  	register u_char *cp;
-	register u_char *oldpath = buf1, *path = buf2;
-	register u_int i, j;
+	u_char *cp;
+	u_char *oldpath = buf1, *path = buf2;
+	u_int i, j;
 
      	while (fgets(path, sizeof(buf2), stdin) != NULL) {
 

Modified: user/imp/tbemd/usr.bin/locate/code/locate.code.c
==============================================================================
--- user/imp/tbemd/usr.bin/locate/code/locate.code.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/locate/code/locate.code.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -37,6 +37,7 @@
  * $FreeBSD$
  */
 
+#if 0
 #ifndef lint
 static char copyright[] =
 "@(#) Copyright (c) 1989, 1993\n\
@@ -46,6 +47,7 @@ static char copyright[] =
 #ifndef lint
 static char sccsid[] = "@(#)locate.code.c	8.1 (Berkeley) 6/6/93";
 #endif /* not lint */
+#endif
 
 /*
  * PURPOSE:	sorted list compressor (works with a modified 'find'
@@ -122,14 +124,12 @@ int	bgindex(char *);
 void	usage(void);
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
-	register u_char *cp, *oldpath, *path;
+	u_char *cp, *oldpath, *path;
 	int ch, code, count, diffcount, oldcount;
+	u_int i, j;
 	FILE *fp;
-	register int i, j;
 
 	while ((ch = getopt(argc, argv, "")) != -1)
 		switch(ch) {
@@ -256,10 +256,9 @@ main(argc, argv)
 
 #ifndef LOOKUP
 int
-bgindex(bg)			/* Return location of bg in bigrams or -1. */
-	char *bg;
+bgindex(char *bg)		/* Return location of bg in bigrams or -1. */
 {
-	register char bg0, bg1, *p;
+	char bg0, bg1, *p;
 
 	bg0 = bg[0];
 	bg1 = bg[1];
@@ -271,7 +270,7 @@ bgindex(bg)			/* Return location of bg i
 #endif /* !LOOKUP */
 
 void
-usage()
+usage(void)
 {
 	(void)fprintf(stderr,
 	    "usage: locate.code common_bigrams < list > squozen_list\n");

Modified: user/imp/tbemd/usr.bin/lock/Makefile
==============================================================================
--- user/imp/tbemd/usr.bin/lock/Makefile	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/lock/Makefile	Sun Aug 22 21:47:19 2010	(r211654)
@@ -7,6 +7,4 @@ BINMODE=4555
 DPADD=	${LIBCRYPT}
 LDADD=	-lcrypt
 
-WARNS?=	1
-
 .include <bsd.prog.mk>

Modified: user/imp/tbemd/usr.bin/lock/lock.c
==============================================================================
--- user/imp/tbemd/usr.bin/lock/lock.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/lock/lock.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$");
 #include <ctype.h>
 #include <errno.h>
 #include <pwd.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -257,9 +258,9 @@ hi(int signo __unused)
 		if (no_timeout) {
 			(void)putchar('\n');
 		} else {
-			(void)printf("timeout in %ld:%ld minutes\n",
-			    (nexttime - timval.tv_sec) / 60,
-			    (nexttime - timval.tv_sec) % 60);
+			(void)printf("timeout in %jd:%jd minutes\n",
+			    (intmax_t)(nexttime - timval.tv_sec) / 60,
+			    (intmax_t)(nexttime - timval.tv_sec) % 60);
 		}
 	}
 }

Modified: user/imp/tbemd/usr.bin/make/str.c
==============================================================================
--- user/imp/tbemd/usr.bin/make/str.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/make/str.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -150,7 +150,7 @@ brk_string(ArgArray *aa, const char str[
 
 	ArgArray_Init(aa);
 
-	aa->buffer = estrdup(str);;
+	aa->buffer = estrdup(str);
 
 	arg = aa->buffer;
 	start = arg;

Modified: user/imp/tbemd/usr.bin/ministat/ministat.1
==============================================================================
--- user/imp/tbemd/usr.bin/ministat/ministat.1	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/ministat/ministat.1	Sun Aug 22 21:47:19 2010	(r211654)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd December 20, 2007
+.Dd June 28, 2010
 .Dt MINISTAT 1
 .Os
 .Sh NAME
@@ -93,7 +93,7 @@ all statistical purposes identical.
 You have the option of lowering your standards by specifying a
 lower confidence level:
 .Bd -literal -offset indent
-  $ ministat -c 80 iguana chameleon
+  $ ministat -s -w 60 -c 80 iguana chameleon
   x iguana
   + chameleon
   +------------------------------------------------------------+

Modified: user/imp/tbemd/usr.bin/netstat/if.c
==============================================================================
--- user/imp/tbemd/usr.bin/netstat/if.c	Sun Aug 22 21:44:51 2010	(r211653)
+++ user/imp/tbemd/usr.bin/netstat/if.c	Sun Aug 22 21:47:19 2010	(r211654)
@@ -562,7 +562,7 @@ sidewaysintpr(int interval1, u_long off)
 			interesting = ip;
 			interesting_off = off;
 		}
-		snprintf(ip->ift_name, sizeof(ip->ift_name), "(%s)", name);;
+		snprintf(ip->ift_name, sizeof(ip->ift_name), "(%s)", name);
 		if ((ipn = malloc(sizeof(struct iftot))) == NULL) {
 			printf("malloc failed\n");
 			exit(1);


More information about the svn-src-user mailing list