public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes!
@ 2015-10-16  1:44 Dave Chinner
  2015-10-16  1:44 ` [PATCH 1/8] cleanup: get rid of ASSERT Dave Chinner
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

Hi folks,

Turns out that changes to exported XFS headers in xfsprogs v4.2.0
broke the xfsdump build. the XFS dump build was implicitly including
the platform definitions calculated for the xfsprogs build and so
removing them from the xfsprogs headers made xfsdump very unhappy.

I've spend the last couple of days dripping blood from my eyeballs
all over my keyboard trying to clean up the mess a bit. This patch
set fixes the build issue and tries to minimise the amount of XFS
header inclusion across the xfsdump code base.

To this end:

	1. remove xfsdump's use of ASSERT because the definition in
	the XFs headers overrode everything else. So the first patch
	is a global s/ASSERT/assert/, #include <assert.h> change.

	2. fix the build issues. With the assert conflict out of the
	way, patch 2 includes all the bits xfsdump really needed
	from the xfsprogs platform defs. This is added to the
	include/config.h.in file, and this is then included across
	the code base.

	3. xfs/jdm.h does "typedef int intgen_t;" for it's API.
	xfsdump uses it *everywhere* (~900 instances across the code
	base), yet everywhere it is used an "int" will sufficient
	and there's only a handful of jdm_* API calls anyway.  Patch
	3 is therefore s/intgen_t/int/g

	4. why use uint*_t when you can use a random mix of types?
	Patch 4 is therefore s/u_int/uint/g

	5. xfs_ino_t. Always going to be uint64_t. Use a local
	definition, not pull all of XFS into all of xfsdump just for
	a single typedef (patch 5).

	6. Use <uuid/uuid.h>, not whatever hacked up uuid interface
	that you get from the XFS headers, which is not then used
	correctly because nothing uses the "platform_uuid_*()"
	abstraction the XFS headers provide. Clearly, xfsdump has
	only *ever* been compiled on Linux, as the build will break
	on BSD based platforms like Irix and FreeBSD. xfsdump is a
	Linux only source tree right now....

	7. Yeah, lets put random stuff in a header file that is
	included all over the place that requires the XFS headers to
	be included. Patch 7 pulls out the bits used by
	logging/reporting and puts them in the logging/reporting
	source files.

	8. Kill as many <xfs/xfs.h> and <xfs/jdm.h> includes as
	possible. Most of the files including them are now just
	missing system header includes and no longer need util.h, so
	patch 8 cleans up all that mess. 

So, now the code base is a little bit cleaner, a lot less dependent
on the xfsprogs header files, compiles cleanly on xfsprogs 3.2.x and
4.x releases, can easily have asserts build in or excluded (distro
packages need to use "export DEBUG=-DNDEBUG" to exclude asserts),
passes xfstests with asserts enabled and disabled, and best of all
the source code is a little less eye-bleedy.

I really don't expect anyone to review this closely - it's *huge*
chunk of boring search/replace change:

 94 files changed, 2929 insertions(+), 2652 deletions(-)

but I would like people to comment on/ack the approach I've taken
here. If nobody objects/cares, I'll then do a 3.1.6 release early
next week....

-Dave.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-28 11:51   ` Brian Foster
  2015-10-16  1:44 ` [PATCH 2/8] build: don't rely on xfs/xfs.h to include necessary headers Dave Chinner
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

ASSERT comes from the xfs/xfs.h include, and we don't ever define
DEBUG so we never get asserts built in. We want asserts built in for
testing, but not for distro packages. The debian package already
tries to do this by using "export DEBUG=-DNDEBUG" for the build
context, but seeing as we pull in #define ASSERT(ex) (0) from the
XFS headers it's a no-op.

Convert all the ASSERT calls to assert to remove this conflict with
the xfsprogs headers and so local developer builds are built with
asserts enabled.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/arch_xlate.c     |   1 +
 common/cldmgr.c         |   3 +-
 common/cleanup.c        |   7 +-
 common/content_common.c |  13 +-
 common/content_inode.h  |   4 +-
 common/dlog.c           |  13 +-
 common/drive.c          |  17 ++-
 common/drive_minrmt.c   | 369 ++++++++++++++++++++++-----------------------
 common/drive_scsitape.c | 389 ++++++++++++++++++++++++------------------------
 common/drive_simple.c   | 151 +++++++++----------
 common/fs.c             |  23 +--
 common/global.c         |  13 +-
 common/hsmapi.c         |   1 +
 common/inventory.c      |  33 ++--
 common/lock.c           |   3 +-
 common/main.c           |  99 ++++++------
 common/media.c          |  21 +--
 common/mlog.c           |  21 +--
 common/openutil.c       |   3 +-
 common/path.c           |  25 ++--
 common/qlock.c          |  29 ++--
 common/ring.c           |  65 ++++----
 common/stream.c         |  15 +-
 common/util.c           |  41 ++---
 dump/content.c          | 239 ++++++++++++++---------------
 dump/inomap.c           |  19 +--
 inventory/inv_api.c     |  33 ++--
 inventory/inv_core.c    |   7 +-
 inventory/inv_files.c   |   9 +-
 inventory/inv_fstab.c   |   5 +-
 inventory/inv_idx.c     |  11 +-
 inventory/inv_mgr.c     |   7 +-
 inventory/inv_oref.c    |  51 +++----
 inventory/inv_oref.h    |  24 +--
 inventory/inv_stobj.c   |  23 +--
 inventory/testmain.c    |  25 ++--
 librmt/rmtioctl.c       |   1 +
 restore/bag.c           |  19 +--
 restore/content.c       | 309 +++++++++++++++++++-------------------
 restore/dirattr.c       | 113 +++++++-------
 restore/inomap.c        |  25 ++--
 restore/namreg.c        |  39 ++---
 restore/node.c          |  79 +++++-----
 restore/tree.c          | 219 +++++++++++++--------------
 restore/win.c           |  65 ++++----
 45 files changed, 1362 insertions(+), 1319 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index bafc1a6..e6f897e 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -18,6 +18,7 @@
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
+#include <assert.h>
 
 #include "arch_xlate.h"
 #include "types.h"
diff --git a/common/cldmgr.c b/common/cldmgr.c
index be7de34..df33a3f 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -25,6 +25,7 @@
 #include <sys/prctl.h>
 #include <errno.h>
 #include <pthread.h>
+#include <assert.h>
 
 #include "exit.h"
 #include "types.h"
@@ -79,7 +80,7 @@ cldmgr_create( int ( * entry )( void *arg1 ),
 	cld_t *cldp;
 	intgen_t rval;
 
-	ASSERT( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
+	assert( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
 
 	cldp = cldmgr_getcld( );
 	if ( ! cldp ) {
diff --git a/common/cleanup.c b/common/cleanup.c
index 42e8750..523f164 100644
--- a/common/cleanup.c
+++ b/common/cleanup.c
@@ -17,6 +17,7 @@
  */
 
 #include <stdlib.h>
+#include <assert.h>
 
 #include "cleanup.h"
 
@@ -51,7 +52,7 @@ cleanup_register_base( void ( * funcp )( void *arg1, void *arg2 ),
 	cu_t *p;
 
 	p = ( cu_t * )calloc( 1, sizeof( cu_t ));
-	ASSERT( p );
+	assert( p );
 	p->cu_funcp = funcp;
 	p->cu_arg1 = arg1;
 	p->cu_arg2 = arg2;
@@ -94,7 +95,7 @@ cleanup_cancel( cleanup_t *cleanupp )
 	cu_t *nextp;
 	cu_t *prevp;
 
-	ASSERT( cu_rootp );
+	assert( cu_rootp );
 
 	for ( prevp = 0, nextp = cu_rootp
 	      ;
@@ -103,7 +104,7 @@ cleanup_cancel( cleanup_t *cleanupp )
 	      prevp = nextp, nextp = nextp->cu_nextp )
 	;
 
-	ASSERT( nextp );
+	assert( nextp );
 	if ( prevp ) {
 		prevp->cu_nextp = p->cu_nextp;
 	} else {
diff --git a/common/content_common.c b/common/content_common.c
index 993ddae..65be31f 100644
--- a/common/content_common.c
+++ b/common/content_common.c
@@ -24,6 +24,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -66,7 +67,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* query: ask if media changed or declined
@@ -77,13 +78,13 @@ retry:
 		 (unsigned int)drivep->d_index );
 	querycnt = 0;
 	querystr[ querycnt++ ] = question;
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	dontix = choicecnt;
 	choicestr[ choicecnt++ ] = _("media change declined");
 	doix = choicecnt;
 	choicestr[ choicecnt++ ] = _("media changed");
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query( querystr,
@@ -105,11 +106,11 @@ retry:
 	} else if ( responseix == dontix ) {
 		ackstr[ ackcnt++ ] = _("media change aborted\n");
 	} else {
-		ASSERT( responseix == sigintix );
+		assert( responseix == sigintix );
 		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_multi_ack( ackstr,
 			ackcnt );
 
@@ -118,7 +119,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
diff --git a/common/content_inode.h b/common/content_inode.h
index 8f0390c..9013ca4 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -389,7 +389,7 @@ calc_checksum(void *bufp, size_t len)
 	u_int32_t sum = 0;
 	u_int32_t *sump = bufp;
 	u_int32_t *endp = sump + len / sizeof(u_int32_t);
-	ASSERT(len % sizeof(u_int32_t) == 0);
+	assert(len % sizeof(u_int32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
 	return ~sum + 1;
@@ -401,7 +401,7 @@ is_checksum_valid(void *bufp, size_t len)
 	u_int32_t sum = 0;
 	u_int32_t *sump = bufp;
 	u_int32_t *endp = sump + len / sizeof(u_int32_t);
-	ASSERT(len % sizeof(u_int32_t) == 0);
+	assert(len % sizeof(u_int32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
 	return sum == 0 ? BOOL_TRUE : BOOL_FALSE;
diff --git a/common/dlog.c b/common/dlog.c
index ac0cafc..6220cfe 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -26,6 +26,7 @@
 #include <time.h>
 #include <errno.h>
 #include <signal.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -57,7 +58,7 @@ dlog_init( int argc, char *argv[ ] )
 
 	/* can only call once
 	 */
-	ASSERT( dlog_ttyfd == -1 );
+	assert( dlog_ttyfd == -1 );
 
 	/* initially allow dialog, use stdin fd
 	 */
@@ -104,7 +105,7 @@ dlog_init( int argc, char *argv[ ] )
 		struct stat statbuf;
 		int rval;
 
-		ASSERT( dlog_ttyfd >= 0 );
+		assert( dlog_ttyfd >= 0 );
 		rval = fstat( dlog_ttyfd, &statbuf );
 		if ( rval ) {
 			mlog( MLOG_VERBOSE | MLOG_WARNING,
@@ -186,7 +187,7 @@ dlog_multi_query( char *querystr[ ],
 
 	/* sanity
 	 */
-	ASSERT( dlog_allowed_flag );
+	assert( dlog_allowed_flag );
 
 	/* display query description strings
 	 */
@@ -295,7 +296,7 @@ dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
 
 	/* sanity
 	 */
-	ASSERT( dlog_allowed_flag );
+	assert( dlog_allowed_flag );
 
 	/* call the caller's callback with his context, print context, and
 	 * print operator
@@ -359,7 +360,7 @@ dlog_string_query_print( void *ctxp, char *fmt, ... )
 {
 	va_list args;
 
-	ASSERT( ! ctxp );
+	assert( ! ctxp );
 
 	va_start( args, fmt );
 	mlog_va( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args );
@@ -510,7 +511,7 @@ promptinput( char *buf,
 		}
 		return BOOL_FALSE;
 	} else {
-		ASSERT( dlog_signo_received == -1 );
+		assert( dlog_signo_received == -1 );
 		*exceptionixp = 0;
 		return BOOL_TRUE;
 	}
diff --git a/common/drive.c b/common/drive.c
index 32a7191..f9ba851 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -21,6 +21,7 @@
 
 #include <sys/stat.h>
 #include <time.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -88,7 +89,7 @@ drive_init1( int argc, char *argv[ ] )
 
 	/* sanity check asserts
 	 */
-	ASSERT( sizeof( drive_hdr_t ) == DRIVE_HDR_SZ );
+	assert( sizeof( drive_hdr_t ) == DRIVE_HDR_SZ );
 
 	/* count drive arguments
 	 */
@@ -107,7 +108,7 @@ drive_init1( int argc, char *argv[ ] )
 	 */
 	if (drivecnt > 0) {
 		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
-		ASSERT( drivepp );
+		assert( drivepp );
 	}
 
 	/* initialize the partialmax value.  Each drive can be completing a file
@@ -142,7 +143,7 @@ drive_init1( int argc, char *argv[ ] )
 			break;
 		}
 	}
-	ASSERT( driveix == drivecnt );
+	assert( driveix == drivecnt );
 
 	/* the user may specify stdin as the source, by
 	 * a single dash ('-') with no option letter. This must appear
@@ -169,7 +170,7 @@ drive_init1( int argc, char *argv[ ] )
 		 * allocate an array to hold ptrs to drive descriptors
 		 */
 		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
-		ASSERT( drivepp );
+		assert( drivepp );
 
 		drivepp[ 0 ] = drive_alloc( "stdio", 0 );
 
@@ -215,7 +216,7 @@ drive_init1( int argc, char *argv[ ] )
 				bestscore = score;
 			}
 		}
-		ASSERT( bestsp );
+		assert( bestsp );
 		drivep->d_strategyp = bestsp;
 		drivep->d_recmarksep = bestsp->ds_recmarksep;
 		drivep->d_recmfilesz = bestsp->ds_recmfilesz;
@@ -356,7 +357,7 @@ drive_alloc( char *pathname, ix_t driveix )
 	/* allocate the descriptor
 	 */
 	drivep = ( drive_t * )calloc( 1, sizeof( drive_t ));
-	ASSERT( drivep );
+	assert( drivep );
 
 	/* convert the pathname to an absolute pathname
 	 * NOTE: string "stdio" is reserved to mean send to standard out
@@ -397,7 +398,7 @@ drive_allochdrs( drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix )
 	/* allocate the read header
 	 */
 	grhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-	ASSERT( grhdrp );
+	assert( grhdrp );
 	gwhdrp = NULL;
 	dwhdrp = NULL;
 
@@ -411,7 +412,7 @@ drive_allochdrs( drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix )
 		/* allocate the write header
 		 */
 		gwhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-		ASSERT( gwhdrp );
+		assert( gwhdrp );
 
 		/* copy the template
 		 */
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 8c57699..6d58f1f 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -29,6 +29,7 @@
 #include <sys/sysmacros.h>
 #include <malloc.h>
 #include <sched.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -471,11 +472,11 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 
 	/* opportunity for sanity checking
 	 */
-	ASSERT( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	ASSERT( sizeof( rec_hdr_t )
+	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
+	assert( sizeof( rec_hdr_t )
 		==
 		sizeofmember( drive_hdr_t, dh_specific ));
-	ASSERT( ! ( STAPE_MAX_RECSZ % PGSZ ));
+	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
 
 	/* hook up the drive ops
 	 */
@@ -484,7 +485,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	/* allocate context for the drive manager
 	 */
 	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	ASSERT( contextp );
+	assert( contextp );
 	memset( ( void * )contextp, 0, sizeof( *contextp ));
 
 	/* do not enable a separate I/O thread,
@@ -583,7 +584,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
 		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		ASSERT( contextp->dc_bufp );
+		assert( contextp->dc_bufp );
 	} else {
 		intgen_t rval;
 		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
@@ -611,7 +612,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 				      _("not allowed "
 				      "to pin down I/O buffer ring\n") );
 			} else {
-				ASSERT( 0 );
+				assert( 0 );
 			}
 			return BOOL_FALSE;
 		}
@@ -721,18 +722,18 @@ do_begin_read( drive_t *drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( drivep->d_capabilities & DRIVE_CAP_READ );
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( ! contextp->dc_recp );
+	assert( drivep->d_capabilities & DRIVE_CAP_READ );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( ! contextp->dc_recp );
 
 	/* get a record buffer to use during initialization.
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		ASSERT( contextp->dc_ringp );
+		assert( contextp->dc_ringp );
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -742,7 +743,7 @@ do_begin_read( drive_t *drivep )
 	 */
 	contextp->dc_iocnt = 0;
 	if ( contextp->dc_fd < 0 ) {
-		ASSERT( contextp->dc_fd == -1 );
+		assert( contextp->dc_fd == -1 );
 		rval = prepare_drive( drivep );
 		if ( rval ) {
 			if ( ! contextp->dc_singlethreadedpr ) {
@@ -763,7 +764,7 @@ do_begin_read( drive_t *drivep )
 			return rval;
 		}
 	}
-	ASSERT( contextp->dc_iocnt == 1 );
+	assert( contextp->dc_iocnt == 1 );
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
@@ -824,10 +825,10 @@ do_read( drive_t *drivep,
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( wantedcnt > 0 );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( wantedcnt > 0 );
 
 	/* clear the return status field
 	 */
@@ -853,7 +854,7 @@ do_read( drive_t *drivep,
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert( contextp->dc_nextp <= contextp->dc_dataendp );
 
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "rmt drive op read actual == %d (0x%x)\n",
@@ -886,16 +887,16 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( contextp->dc_ownedp );
-	ASSERT( bufp == contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( contextp->dc_ownedp );
+	assert( bufp == contextp->dc_ownedp );
 
 	/* calculate how much the caller owns
 	 */
-	ASSERT( contextp->dc_nextp >= contextp->dc_ownedp );
+	assert( contextp->dc_nextp >= contextp->dc_ownedp );
 	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	ASSERT( ownedcnt == retcnt );
+	assert( ownedcnt == retcnt );
 
 	/* take possession of buffer portion
 	 */
@@ -905,7 +906,7 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
 	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		ASSERT( contextp->dc_nextp == contextp->dc_dataendp );
+		assert( contextp->dc_nextp == contextp->dc_dataendp );
 		if ( ! contextp->dc_singlethreadedpr ) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
 			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
@@ -936,9 +937,9 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
@@ -977,9 +978,9 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 
 	/* the desired mark is passed by reference, and is really just an
@@ -1002,18 +1003,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
-		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+		assert( contextp->dc_nextp >= contextp->dc_recp );
 		recoff = ( u_int32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
-		ASSERT( recoff <= tape_recsz );
-		ASSERT( rechdrp->rec_used <= tape_recsz );
-		ASSERT( recoff >= STAPE_HDR_SZ );
-		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-		ASSERT( recoff <= rechdrp->rec_used );
+		assert( recoff <= tape_recsz );
+		assert( rechdrp->rec_used <= tape_recsz );
+		assert( recoff >= STAPE_HDR_SZ );
+		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+		assert( recoff <= rechdrp->rec_used );
 		currentoffset += ( off64_t )recoff;
 	}
-	ASSERT( wantedoffset >= currentoffset );
+	assert( wantedoffset >= currentoffset );
 	
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
@@ -1036,12 +1037,12 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			 * must be just after it.
 			 */
 			if ( rechdrp->rec_used < tape_recsz ) {
-				ASSERT( wantedoffset == nextrecoffset );
+				assert( wantedoffset == nextrecoffset );
 			}
 
 			/* figure how much to ask for
 			 */
-			ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+			assert( contextp->dc_nextp >= contextp->dc_recp );
 			recoff = ( u_int32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
@@ -1059,13 +1060,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			if ( rval ) {
 				return rval;
 			}
-			ASSERT( actualcnt == wantedcnt );
+			assert( actualcnt == wantedcnt );
 			do_return_read_buf( drivep, dummybufp, actualcnt );
 			currentoffset += ( off64_t )actualcnt;
-			ASSERT( currentoffset == nextrecoffset );
-			ASSERT( wantedoffset >= currentoffset );
-			ASSERT( ! contextp->dc_recp );
-			ASSERT( currentoffset
+			assert( currentoffset == nextrecoffset );
+			assert( wantedoffset >= currentoffset );
+			assert( ! contextp->dc_recp );
+			assert( currentoffset
 				==
 				contextp->dc_reccnt * ( off64_t )tape_recsz );
 		}
@@ -1084,14 +1085,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 		
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
 		if ( contextp->dc_singlethreadedpr ) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		ASSERT( wantedreccnt != 0 ); /* so NOP below can be
+		assert( wantedreccnt != 0 ); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
@@ -1101,7 +1102,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 			if ( seekmode == SEEKMODE_BUF ) {
 				ring_stat_t rs;
-				ASSERT( ! contextp->dc_msgp );
+				assert( ! contextp->dc_msgp );
 				contextp->dc_msgp =
 						Ring_get( contextp->dc_ringp );
 				rs = contextp->dc_msgp->rm_stat;
@@ -1114,7 +1115,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				     rs != RING_STAT_INIT
 				     &&
 				     rs != RING_STAT_NOPACK ) {
-					ASSERT( 0 );
+					assert( 0 );
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
@@ -1136,8 +1137,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				continue;
 			}
 
-			ASSERT( contextp->dc_reccnt == contextp->dc_iocnt );
-			ASSERT( wantedreccnt > contextp->dc_reccnt );
+			assert( contextp->dc_reccnt == contextp->dc_iocnt );
+			assert( wantedreccnt > contextp->dc_reccnt );
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
 			while ( recskipcnt64remaining ) {
@@ -1145,14 +1146,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				intgen_t saved_errno;
 				intgen_t rval;
 
-				ASSERT( recskipcnt64remaining > 0 );
+				assert( recskipcnt64remaining > 0 );
 				if ( recskipcnt64remaining > INTGENMAX ) {
 					recskipcnt = INTGENMAX;
 				} else {
 					recskipcnt = ( intgen_t )
 						     recskipcnt64remaining;
 				}
-				ASSERT( recskipcnt > 0 );
+				assert( recskipcnt > 0 );
 				rval = mt_op( contextp->dc_fd,
 					      MTFSR,
 					      recskipcnt );
@@ -1174,8 +1175,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			currentoffset = contextp->dc_reccnt
 					*
 					( off64_t )tape_recsz;
-			ASSERT( wantedoffset >= currentoffset );
-			ASSERT( wantedoffset - currentoffset
+			assert( wantedoffset >= currentoffset );
+			assert( wantedoffset - currentoffset
 				<
 				( off64_t )tape_recsz );
 		}
@@ -1190,7 +1191,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		size_t actualcnt;
 		intgen_t rval;
 
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
@@ -1205,11 +1206,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		if ( rval ) {
 			return rval;
 		}
-		ASSERT( actualcnt == wantedcnt );
+		assert( actualcnt == wantedcnt );
 		do_return_read_buf( drivep, dummybufp, actualcnt );
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 		currentoffset += ( off64_t )tape_recsz;
-		ASSERT( currentoffset
+		assert( currentoffset
 			==
 			contextp->dc_reccnt * ( off64_t )tape_recsz );
 	}
@@ -1222,8 +1223,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		char *dummybufp;
 		size_t actualcnt;
 
-		ASSERT( wantedoffset > currentoffset );
-		ASSERT( wantedoffset - currentoffset < ( off64_t )tape_recsz );
+		assert( wantedoffset > currentoffset );
+		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
 		wantedcnt = ( size_t )( wantedoffset - currentoffset );
 		if ( contextp->dc_recp ) {
 			u_int32_t recoff;
@@ -1233,14 +1234,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			recoff = ( u_int32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
-			ASSERT( recoff <= tape_recsz );
-			ASSERT( rechdrp->rec_used <= tape_recsz );
-			ASSERT( recoff >= STAPE_HDR_SZ );
-			ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-			ASSERT( recoff <= rechdrp->rec_used );
-			ASSERT( recoff + wantedcnt <= rechdrp->rec_used );
+			assert( recoff <= tape_recsz );
+			assert( rechdrp->rec_used <= tape_recsz );
+			assert( recoff >= STAPE_HDR_SZ );
+			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+			assert( recoff <= rechdrp->rec_used );
+			assert( recoff + wantedcnt <= rechdrp->rec_used );
 		} else {
-			ASSERT( wantedcnt >= STAPE_HDR_SZ );
+			assert( wantedcnt >= STAPE_HDR_SZ );
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
@@ -1253,7 +1254,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		    if ( rval ) {
 			    return rval;
 		    }
-		    ASSERT( actualcnt == wantedcnt );
+		    assert( actualcnt == wantedcnt );
 		    do_return_read_buf( drivep, dummybufp, actualcnt );
 		}
 	}
@@ -1268,18 +1269,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
-		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+		assert( contextp->dc_nextp >= contextp->dc_recp );
 		recoff = ( u_int32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
-		ASSERT( recoff <= tape_recsz );
-		ASSERT( rechdrp->rec_used <= tape_recsz );
-		ASSERT( recoff >= STAPE_HDR_SZ );
-		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-		ASSERT( recoff <= rechdrp->rec_used );
+		assert( recoff <= tape_recsz );
+		assert( rechdrp->rec_used <= tape_recsz );
+		assert( recoff >= STAPE_HDR_SZ );
+		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+		assert( recoff <= rechdrp->rec_used );
 		currentoffset += ( off64_t )recoff;
 	}
-	ASSERT( wantedoffset == currentoffset );
+	assert( wantedoffset == currentoffset );
 
 	return 0;
 }
@@ -1310,9 +1311,9 @@ do_next_mark( drive_t *drivep )
 
 	/* assert protocol being followed.
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: next mark\n" );
@@ -1335,7 +1336,7 @@ noerrorsearch:
 		}
 		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 
-		ASSERT( rechdrp->first_mark_offset != 0 );
+		assert( rechdrp->first_mark_offset != 0 );
 		if ( rechdrp->first_mark_offset > 0 ) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
@@ -1343,8 +1344,8 @@ noerrorsearch:
 			 off64_t curoff = ( off64_t )( contextp->dc_nextp
 						       -
 						       contextp->dc_recp );
-			 ASSERT( markoff > 0 );
-			 ASSERT( curoff > 0 );
+			 assert( markoff > 0 );
+			 assert( curoff > 0 );
 			 if ( markoff >= curoff ) {
 				break;
 			}
@@ -1359,7 +1360,7 @@ noerrorsearch:
 		contextp->dc_reccnt++;
 	}
 
-	ASSERT( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert( rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
 		( off64_t )tape_recsz );
 	contextp->dc_nextp = contextp->dc_recp
@@ -1367,8 +1368,8 @@ noerrorsearch:
 			     ( size_t )( rechdrp->first_mark_offset
 					 -
 					 rechdrp->file_offset );
-	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
-	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
+	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
 	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
 		if ( ! contextp->dc_singlethreadedpr ) {
 			Ring_put( contextp->dc_ringp,
@@ -1394,7 +1395,7 @@ resetring:
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
@@ -1417,7 +1418,7 @@ validateread:
 	}
 
 	if ( nread >= 0 ) {
-		ASSERT( ( size_t )nread <= tape_recsz );
+		assert( ( size_t )nread <= tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
@@ -1460,24 +1461,24 @@ validatehdr:
 		goto readrecord;
 	}
 
-	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	ASSERT( markoff >= ( off64_t )STAPE_HDR_SZ );
-	ASSERT( markoff < ( off64_t )tape_recsz );
-	ASSERT( rechdrp->rec_used > STAPE_HDR_SZ );
-	ASSERT( rechdrp->rec_used < tape_recsz );
+	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
+	assert( markoff < ( off64_t )tape_recsz );
+	assert( rechdrp->rec_used > STAPE_HDR_SZ );
+	assert( rechdrp->rec_used < tape_recsz );
 
 	goto alliswell;
 
 alliswell:
 	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
 	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	ASSERT( contextp->dc_dataendp <= contextp->dc_recendp );
-	ASSERT( contextp->dc_nextp < contextp->dc_dataendp );
+	assert( contextp->dc_dataendp <= contextp->dc_recendp );
+	assert( contextp->dc_nextp < contextp->dc_dataendp );
 	contextp->dc_errorpr = BOOL_FALSE;
 
 	mlog( MLOG_NORMAL | MLOG_DRIVE,
@@ -1553,8 +1554,8 @@ do_end_read( drive_t *drivep )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
 
 	/* In the scsi version, read_label() does a status command to the
 	 * drive to then decide if doing a 'fsf' is appropriate.  For minrmt,
@@ -1608,9 +1609,9 @@ do_begin_write( drive_t *drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( ! drivep->d_markrecheadp );
-	ASSERT( ! contextp->dc_recp );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( ! drivep->d_markrecheadp );
+	assert( ! contextp->dc_recp );
 
 	/* get pointers into global write header
 	 */
@@ -1621,7 +1622,7 @@ do_begin_write( drive_t *drivep )
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with tape requires reading first.
 	 */
-	ASSERT( contextp->dc_fd != -1 );
+	assert( contextp->dc_fd != -1 );
 
 	/* fill in write header's drive specific info
 	 */
@@ -1637,15 +1638,15 @@ do_begin_write( drive_t *drivep )
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	ASSERT( ! contextp->dc_recp );
+	assert( ! contextp->dc_recp );
 	if ( contextp->dc_singlethreadedpr ) {
-		ASSERT( contextp->dc_bufp );
+		assert( contextp->dc_bufp );
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		ASSERT( contextp->dc_ringp );
-		ASSERT( ! contextp->dc_msgp );
+		assert( contextp->dc_ringp );
+		assert( ! contextp->dc_msgp );
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1690,7 +1691,7 @@ do_begin_write( drive_t *drivep )
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	ASSERT( ! contextp->dc_ownedp );
+	assert( ! contextp->dc_ownedp );
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1735,15 +1736,15 @@ do_set_mark( drive_t *drivep,
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
 
 	/* calculate and fill in the mark record offset
 	 */
-	ASSERT( contextp->dc_recp );
+	assert( contextp->dc_recp );
 	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
 		  +
 		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
@@ -1758,7 +1759,7 @@ do_set_mark( drive_t *drivep,
 	 */
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 	if ( rechdrp->first_mark_offset == -1LL ) {
-		ASSERT( nextoff != -1LL );
+		assert( nextoff != -1LL );
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1771,7 +1772,7 @@ do_set_mark( drive_t *drivep,
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		ASSERT( drivep->d_markrectailp );
+		assert( drivep->d_markrectailp );
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1798,12 +1799,12 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
@@ -1864,17 +1865,17 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp <= contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp <= contextp->dc_recendp );
 
 	/* verify the caller is returning exactly what is held
 	 */
-	ASSERT( bufp == contextp->dc_ownedp );
-	ASSERT( retcnt == heldcnt );
+	assert( bufp == contextp->dc_ownedp );
+	assert( retcnt == heldcnt );
 
 	/* take it back
 	 */
@@ -1915,7 +1916,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			ASSERT( 0 );
+			assert( 0 );
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -1979,12 +1980,12 @@ do_get_align_cnt( drive_t * drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
@@ -1994,11 +1995,11 @@ do_get_align_cnt( drive_t * drivep )
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = ( char * )next_alignment_off;
-	ASSERT( next_alignment_point <= contextp->dc_recendp );
+	assert( next_alignment_point <= contextp->dc_recendp );
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	ASSERT( next_alignment_point >= contextp->dc_nextp );
+	assert( next_alignment_point >= contextp->dc_nextp );
 	return ( size_t )( next_alignment_point - contextp->dc_nextp );
 }
 
@@ -2025,12 +2026,12 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2072,7 +2073,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 					     contextp->dc_recp,
 					     BOOL_TRUE, BOOL_TRUE );
 		} else {
-			ASSERT( contextp->dc_msgp );
+			assert( contextp->dc_msgp );
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
 			Ring_put( contextp->dc_ringp,
@@ -2088,7 +2089,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2115,7 +2116,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	}
 	if ( ! contextp->dc_singlethreadedpr ) {
 		while ( ! rval ) {
-			ASSERT( contextp->dc_msgp );
+			assert( contextp->dc_msgp );
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
 			Ring_put( contextp->dc_ringp,
 				  contextp->dc_msgp );
@@ -2127,14 +2128,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 			switch( contextp->dc_msgp->rm_stat ) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				ASSERT( rval == 0 );
+				assert( rval == 0 );
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2182,11 +2183,11 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * to tape.
 	 */
 	if ( rval ) {
-		ASSERT( first_rec_w_err >= 0 );
+		assert( first_rec_w_err >= 0 );
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		ASSERT( first_rec_w_err == -1 );
+		assert( first_rec_w_err == -1 );
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
@@ -2217,14 +2218,14 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_mode == OM_NONE );
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: fsf: count %d\n",
 	      count );
 
-	ASSERT( count );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( count );
+	assert( contextp->dc_mode == OM_NONE );
 
 	for ( i = 0 ; i < count; i++ ) {
 		done = 0;
@@ -2243,7 +2244,7 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 			      _("advancing tape to next media file\n") );
 
 			op_failed = 0;
-			ASSERT( contextp->dc_fd >= 0 );
+			assert( contextp->dc_fd >= 0 );
 			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
 				op_failed = 1;
 			}
@@ -2294,14 +2295,14 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 	      "rmt drive op: bsf: count %d\n",
 	      count );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_mode == OM_NONE );
 
 	*statp = 0;
 
 	/* back space - places us to left of previous file mark
 	 * if we hit BOT, return
 	 */
-	ASSERT( drivep->d_capabilities & DRIVE_CAP_BSF );
+	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
 	rval = bsf_and_verify( drivep );
 	if (rval) {
 		if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
@@ -2379,8 +2380,8 @@ do_rewind( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: rewind\n" );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
 
 	/* use validating tape rewind util func
 	 */
@@ -2405,8 +2406,8 @@ do_erase( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: erase\n" );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
 
 	/* use validating tape rewind util func
 	 */
@@ -2443,8 +2444,8 @@ do_eject_media( drive_t *drivep )
 
 	/* drive must be open
 	 */
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
 
 	/* issue tape unload
 	 */
@@ -2563,7 +2564,7 @@ read_label( drive_t *drivep )
 	/* if a read error, get status
 	 */
 	if ( nread != ( intgen_t )tape_recsz ) {
-		ASSERT( nread < ( intgen_t )tape_recsz );
+		assert( nread < ( intgen_t )tape_recsz );
 	} 
 
 	/* check for an unexpected errno
@@ -2720,7 +2721,7 @@ get_tpcaps( drive_t *drivep )
 #ifdef DEBUG
 	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 #endif
 
 	/* can't ask about blksz, can't set blksz, can't ask about
@@ -2796,7 +2797,7 @@ mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
 	mop.mt_op   	= (short )sub_op;
 	mop.mt_count	= param;
 
-	ASSERT( fd >= 0 );
+	assert( fd >= 0 );
 
 	switch ( sub_op ) {
 	case MTSEEK:
@@ -3074,7 +3075,7 @@ prepare_drive( drive_t *drivep )
 
 	/* shouldn't be here if drive is open
 	 */
-	ASSERT( contextp->dc_fd == -1 );
+	assert( contextp->dc_fd == -1 );
 
 	mlog( MLOG_VERBOSE | MLOG_DRIVE,
 	      _("preparing drive\n") );
@@ -3181,7 +3182,7 @@ prepare_drive( drive_t *drivep )
 			      contextp->dc_recp,
 			      tape_recsz,
 			      &saved_errno );
-		ASSERT( saved_errno == 0 || nread < 0 );
+		assert( saved_errno == 0 || nread < 0 );
 
 		/* RMT can require a retry
 		 */
@@ -3340,7 +3341,7 @@ checkhdr:
 			rec_hdr_t *tprhdrp;
 			drhdrp = drivep->d_readhdrp;
 			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
-			ASSERT( tprhdrp->recsize >= 0 );
+			assert( tprhdrp->recsize >= 0 );
 			tape_recsz = ( size_t )tprhdrp->recsize;
 			break;
 		}
@@ -3410,7 +3411,7 @@ Open( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: opening drive\n" );
 
-	ASSERT( contextp->dc_fd == -1 );
+	assert( contextp->dc_fd == -1 );
 
 	errno = 0;
 	contextp->dc_fd = open( drivep->d_pathname, oflags );
@@ -3430,7 +3431,7 @@ Close( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: closing drive\n" );
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 
 	( void )close( contextp->dc_fd );
 
@@ -3447,8 +3448,8 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	      "tape op: reading %u bytes\n",
 	      cnt );
 
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( bufp );
+	assert( contextp->dc_fd >= 0 );
+	assert( bufp );
 	*errnop = 0;
 	errno = 0;
 	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
@@ -3483,8 +3484,8 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	      "tape op: writing %u bytes\n",
 	      cnt );
 
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( bufp );
+	assert( contextp->dc_fd >= 0 );
+	assert( bufp );
 	*errnop = 0;
 	errno = 0;
 	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
@@ -3664,7 +3665,7 @@ read_record(  drive_t *drivep, char *bufp )
 	/* short read
 	 */
 	if ( nread >= 0 ) {
-		ASSERT( nread <= ( intgen_t )tape_recsz );
+		assert( nread <= ( intgen_t )tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
@@ -3726,7 +3727,7 @@ getrec( drive_t *drivep )
 				contextp->dc_errorpr = BOOL_TRUE;
 				return contextp->dc_msgp->rm_rval;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_errorpr = BOOL_TRUE;
 				return DRIVE_ERROR_CORE;
 			}
@@ -3739,7 +3740,7 @@ getrec( drive_t *drivep )
 		contextp->dc_nextp = contextp->dc_recp
 				     +
 				     STAPE_HDR_SZ;
-		ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
+		assert( contextp->dc_nextp <= contextp->dc_dataendp );
 	}
 
 	return 0;
@@ -3775,7 +3776,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 	}
 
 	rval = determine_write_error( nwritten, saved_errno );
-	ASSERT(rval);
+	assert(rval);
 
 	return rval;
 }
@@ -3814,7 +3815,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: reset\n" );
 	
-	ASSERT( ringp );
+	assert( ringp );
 
 	ring_reset( ringp, msgp );
 }
@@ -3845,14 +3846,14 @@ display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
 	char *bufszsfxp;
 	
 	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
-		ASSERT( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
+		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
 		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
-		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
+		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
 		bufszsfxp = _("KB");
 	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
-		ASSERT( ! ( STAPE_MAX_RECSZ % 0x100000 ));
+		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
 		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
-		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
+		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
 		bufszsfxp = _("MB");
 	} else {
 		sprintf( bufszbuf, "%u", (unsigned int)(tape_recsz / 0x400) );
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 0abb5d0..3f45d01 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -29,6 +29,7 @@
 #include <sys/sysmacros.h>
 #include <malloc.h>
 #include <sched.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -551,11 +552,11 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 
 	/* opportunity for sanity checking
 	 */
-	ASSERT( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
-	ASSERT( sizeof( rec_hdr_t )
+	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
+	assert( sizeof( rec_hdr_t )
 		==
 		sizeofmember( drive_hdr_t, dh_specific ));
-	ASSERT( ! ( STAPE_MAX_RECSZ % PGSZ ));
+	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
 
 	/* hook up the drive ops
 	 */
@@ -564,7 +565,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	/* allocate context for the drive manager
 	 */
 	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
-	ASSERT( contextp );
+	assert( contextp );
 	memset( ( void * )contextp, 0, sizeof( *contextp ));
 
 	/* do not enable a separate I/O thread,
@@ -673,7 +674,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
 		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
-		ASSERT( contextp->dc_bufp );
+		assert( contextp->dc_bufp );
 	} else {
 		intgen_t rval;
 		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
@@ -701,7 +702,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 				      _("not allowed "
 				      "to pin down I/O buffer ring\n") );
 			} else {
-				ASSERT( 0 );
+				assert( 0 );
 			}
 			return BOOL_FALSE;
 		}
@@ -834,18 +835,18 @@ do_begin_read( drive_t *drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( drivep->d_capabilities & DRIVE_CAP_READ );
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( ! contextp->dc_recp );
+	assert( drivep->d_capabilities & DRIVE_CAP_READ );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( ! contextp->dc_recp );
 
 	/* get a record buffer to use during initialization.
 	 */
 	if ( contextp->dc_singlethreadedpr ) {
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		ASSERT( contextp->dc_ringp );
+		assert( contextp->dc_ringp );
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -855,7 +856,7 @@ do_begin_read( drive_t *drivep )
 	 */
 	contextp->dc_iocnt = 0;
 	if ( contextp->dc_fd < 0 ) {
-		ASSERT( contextp->dc_fd == -1 );
+		assert( contextp->dc_fd == -1 );
 		rval = prepare_drive( drivep );
 		if ( rval ) {
 			if ( ! contextp->dc_singlethreadedpr ) {
@@ -876,7 +877,7 @@ do_begin_read( drive_t *drivep )
 			return rval;
 		}
 	}
-	ASSERT( contextp->dc_iocnt == 1 );
+	assert( contextp->dc_iocnt == 1 );
 					/* set by prepare_drive or read_label */
 
 	/* all is well. adjust context. don't kick off read-aheads just yet;
@@ -937,10 +938,10 @@ do_read( drive_t *drivep,
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( wantedcnt > 0 );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( wantedcnt > 0 );
 
 	/* clear the return status field
 	 */
@@ -966,7 +967,7 @@ do_read( drive_t *drivep,
 	 */
 	contextp->dc_ownedp = contextp->dc_nextp;
 	contextp->dc_nextp += actualcnt;
-	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert( contextp->dc_nextp <= contextp->dc_dataendp );
 
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "drive op read actual == %d (0x%x)\n",
@@ -999,16 +1000,16 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( contextp->dc_ownedp );
-	ASSERT( bufp == contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( contextp->dc_ownedp );
+	assert( bufp == contextp->dc_ownedp );
 
 	/* calculate how much the caller owns
 	 */
-	ASSERT( contextp->dc_nextp >= contextp->dc_ownedp );
+	assert( contextp->dc_nextp >= contextp->dc_ownedp );
 	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	ASSERT( ownedcnt == retcnt );
+	assert( ownedcnt == retcnt );
 
 	/* take possession of buffer portion
 	 */
@@ -1018,7 +1019,7 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
 	 * and (if ring in use) give buffer to ring for read-ahead.
 	 */
 	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
-		ASSERT( contextp->dc_nextp == contextp->dc_dataendp );
+		assert( contextp->dc_nextp == contextp->dc_dataendp );
 		if ( ! contextp->dc_singlethreadedpr ) {
 			contextp->dc_msgp->rm_op = RING_OP_READ;
 			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
@@ -1049,9 +1050,9 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 	/* the mark is simply the offset into the media file of the
 	 * next byte to be read.
@@ -1090,9 +1091,9 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 
 	/* the desired mark is passed by reference, and is really just an
@@ -1115,18 +1116,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
-		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+		assert( contextp->dc_nextp >= contextp->dc_recp );
 		recoff = ( u_int32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
-		ASSERT( recoff <= tape_recsz );
-		ASSERT( rechdrp->rec_used <= tape_recsz );
-		ASSERT( recoff >= STAPE_HDR_SZ );
-		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-		ASSERT( recoff <= rechdrp->rec_used );
+		assert( recoff <= tape_recsz );
+		assert( rechdrp->rec_used <= tape_recsz );
+		assert( recoff >= STAPE_HDR_SZ );
+		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+		assert( recoff <= rechdrp->rec_used );
 		currentoffset += ( off64_t )recoff;
 	}
-	ASSERT( wantedoffset >= currentoffset );
+	assert( wantedoffset >= currentoffset );
 	
 	/* if we are currently holding a record and the desired offset
 	 * is not within the current record, eat the current record.
@@ -1149,12 +1150,12 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			 * must be just after it.
 			 */
 			if ( rechdrp->rec_used < tape_recsz ) {
-				ASSERT( wantedoffset == nextrecoffset );
+				assert( wantedoffset == nextrecoffset );
 			}
 
 			/* figure how much to ask for
 			 */
-			ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+			assert( contextp->dc_nextp >= contextp->dc_recp );
 			recoff = ( u_int32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
@@ -1172,13 +1173,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			if ( rval ) {
 				return rval;
 			}
-			ASSERT( actualcnt == wantedcnt );
+			assert( actualcnt == wantedcnt );
 			do_return_read_buf( drivep, dummybufp, actualcnt );
 			currentoffset += ( off64_t )actualcnt;
-			ASSERT( currentoffset == nextrecoffset );
-			ASSERT( wantedoffset >= currentoffset );
-			ASSERT( ! contextp->dc_recp );
-			ASSERT( currentoffset
+			assert( currentoffset == nextrecoffset );
+			assert( wantedoffset >= currentoffset );
+			assert( ! contextp->dc_recp );
+			assert( currentoffset
 				==
 				contextp->dc_reccnt * ( off64_t )tape_recsz );
 		}
@@ -1197,14 +1198,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		off64_t wantedreccnt;
 		seekmode_t seekmode;
 		
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
 		if ( contextp->dc_singlethreadedpr ) {
 			seekmode = SEEKMODE_RAW;
 		} else {
 			seekmode = SEEKMODE_BUF;
 		}
-		ASSERT( wantedreccnt != 0 ); /* so NOP below can be
+		assert( wantedreccnt != 0 ); /* so NOP below can be
 					      * distinguished from use
 					      * in do_begin_read
 					      */
@@ -1214,7 +1215,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 			if ( seekmode == SEEKMODE_BUF ) {
 				ring_stat_t rs;
-				ASSERT( ! contextp->dc_msgp );
+				assert( ! contextp->dc_msgp );
 				contextp->dc_msgp =
 						Ring_get( contextp->dc_ringp );
 				rs = contextp->dc_msgp->rm_stat;
@@ -1227,7 +1228,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				     rs != RING_STAT_INIT
 				     &&
 				     rs != RING_STAT_NOPACK ) {
-					ASSERT( 0 );
+					assert( 0 );
 					contextp->dc_errorpr = BOOL_TRUE;
 					return DRIVE_ERROR_CORE;
 				}
@@ -1249,8 +1250,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				continue;
 			}
 
-			ASSERT( contextp->dc_reccnt == contextp->dc_iocnt );
-			ASSERT( wantedreccnt > contextp->dc_reccnt );
+			assert( contextp->dc_reccnt == contextp->dc_iocnt );
+			assert( wantedreccnt > contextp->dc_reccnt );
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
 			while ( recskipcnt64remaining ) {
@@ -1258,14 +1259,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				intgen_t saved_errno;
 				intgen_t rval;
 
-				ASSERT( recskipcnt64remaining > 0 );
+				assert( recskipcnt64remaining > 0 );
 				if ( recskipcnt64remaining > INTGENMAX ) {
 					recskipcnt = INTGENMAX;
 				} else {
 					recskipcnt = ( intgen_t )
 						     recskipcnt64remaining;
 				}
-				ASSERT( recskipcnt > 0 );
+				assert( recskipcnt > 0 );
 				rval = mt_op( contextp->dc_fd,
 					      MTFSR,
 					      recskipcnt );
@@ -1287,8 +1288,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			currentoffset = contextp->dc_reccnt
 					*
 					( off64_t )tape_recsz;
-			ASSERT( wantedoffset >= currentoffset );
-			ASSERT( wantedoffset - currentoffset
+			assert( wantedoffset >= currentoffset );
+			assert( wantedoffset - currentoffset
 				<
 				( off64_t )tape_recsz );
 		}
@@ -1303,7 +1304,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		size_t actualcnt;
 		intgen_t rval;
 
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 
 		/* figure how much to ask for. to eat an entire record,
 		 * ask for a record sans the header. do_read will eat
@@ -1318,11 +1319,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		if ( rval ) {
 			return rval;
 		}
-		ASSERT( actualcnt == wantedcnt );
+		assert( actualcnt == wantedcnt );
 		do_return_read_buf( drivep, dummybufp, actualcnt );
-		ASSERT( ! contextp->dc_recp );
+		assert( ! contextp->dc_recp );
 		currentoffset += ( off64_t )tape_recsz;
-		ASSERT( currentoffset
+		assert( currentoffset
 			==
 			contextp->dc_reccnt * ( off64_t )tape_recsz );
 	}
@@ -1335,8 +1336,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		char *dummybufp;
 		size_t actualcnt;
 
-		ASSERT( wantedoffset > currentoffset );
-		ASSERT( wantedoffset - currentoffset < ( off64_t )tape_recsz );
+		assert( wantedoffset > currentoffset );
+		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
 		wantedcnt = ( size_t )( wantedoffset - currentoffset );
 		if ( contextp->dc_recp ) {
 			u_int32_t recoff;
@@ -1346,14 +1347,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			recoff = ( u_int32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
-			ASSERT( recoff <= tape_recsz );
-			ASSERT( rechdrp->rec_used <= tape_recsz );
-			ASSERT( recoff >= STAPE_HDR_SZ );
-			ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-			ASSERT( recoff <= rechdrp->rec_used );
-			ASSERT( recoff + wantedcnt <= rechdrp->rec_used );
+			assert( recoff <= tape_recsz );
+			assert( rechdrp->rec_used <= tape_recsz );
+			assert( recoff >= STAPE_HDR_SZ );
+			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+			assert( recoff <= rechdrp->rec_used );
+			assert( recoff + wantedcnt <= rechdrp->rec_used );
 		} else {
-			ASSERT( wantedcnt >= STAPE_HDR_SZ );
+			assert( wantedcnt >= STAPE_HDR_SZ );
 			wantedcnt -= STAPE_HDR_SZ;
 		}
 
@@ -1366,7 +1367,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		    if ( rval ) {
 			    return rval;
 		    }
-		    ASSERT( actualcnt == wantedcnt );
+		    assert( actualcnt == wantedcnt );
 		    do_return_read_buf( drivep, dummybufp, actualcnt );
 		}
 	}
@@ -1381,18 +1382,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
-		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
+		assert( contextp->dc_nextp >= contextp->dc_recp );
 		recoff = ( u_int32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
-		ASSERT( recoff <= tape_recsz );
-		ASSERT( rechdrp->rec_used <= tape_recsz );
-		ASSERT( recoff >= STAPE_HDR_SZ );
-		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
-		ASSERT( recoff <= rechdrp->rec_used );
+		assert( recoff <= tape_recsz );
+		assert( rechdrp->rec_used <= tape_recsz );
+		assert( recoff >= STAPE_HDR_SZ );
+		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
+		assert( recoff <= rechdrp->rec_used );
 		currentoffset += ( off64_t )recoff;
 	}
-	ASSERT( wantedoffset == currentoffset );
+	assert( wantedoffset == currentoffset );
 
 	return 0;
 }
@@ -1425,9 +1426,9 @@ do_next_mark( drive_t *drivep )
 
 	/* assert protocol being followed.
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: next mark\n" );
@@ -1450,7 +1451,7 @@ noerrorsearch:
 		}
 		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 
-		ASSERT( rechdrp->first_mark_offset != 0 );
+		assert( rechdrp->first_mark_offset != 0 );
 		if ( rechdrp->first_mark_offset > 0 ) {
 			 off64_t markoff = rechdrp->first_mark_offset
 					   -
@@ -1458,8 +1459,8 @@ noerrorsearch:
 			 off64_t curoff = ( off64_t )( contextp->dc_nextp
 						       -
 						       contextp->dc_recp );
-			 ASSERT( markoff > 0 );
-			 ASSERT( curoff > 0 );
+			 assert( markoff > 0 );
+			 assert( curoff > 0 );
 			 if ( markoff >= curoff ) {
 				break;
 			}
@@ -1474,7 +1475,7 @@ noerrorsearch:
 		contextp->dc_reccnt++;
 	}
 
-	ASSERT( rechdrp->first_mark_offset - rechdrp->file_offset
+	assert( rechdrp->first_mark_offset - rechdrp->file_offset
 		<=
 		( off64_t )tape_recsz );
 	contextp->dc_nextp = contextp->dc_recp
@@ -1482,8 +1483,8 @@ noerrorsearch:
 			     ( size_t )( rechdrp->first_mark_offset
 					 -
 					 rechdrp->file_offset );
-	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
-	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
+	assert( contextp->dc_nextp <= contextp->dc_dataendp );
+	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
 	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
 		if ( ! contextp->dc_singlethreadedpr ) {
 			Ring_put( contextp->dc_ringp,
@@ -1509,7 +1510,7 @@ resetring:
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
@@ -1561,7 +1562,7 @@ validateread:
 	}
 
 	if ( nread >= 0 ) {
-		ASSERT( ( size_t )nread <= tape_recsz );
+		assert( ( size_t )nread <= tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read (nread == %d, record size == %d)\n",
 		      nread,
@@ -1604,24 +1605,24 @@ validatehdr:
 		goto readrecord;
 	}
 
-	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
 	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
-	ASSERT( markoff >= ( off64_t )STAPE_HDR_SZ );
-	ASSERT( markoff < ( off64_t )tape_recsz );
-	ASSERT( rechdrp->rec_used > STAPE_HDR_SZ );
-	ASSERT( rechdrp->rec_used < tape_recsz );
+	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
+	assert( markoff < ( off64_t )tape_recsz );
+	assert( rechdrp->rec_used > STAPE_HDR_SZ );
+	assert( rechdrp->rec_used < tape_recsz );
 
 	goto alliswell;
 
 alliswell:
 	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
-	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
+	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
 	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
 	contextp->dc_iocnt = contextp->dc_reccnt + 1;
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
-	ASSERT( contextp->dc_dataendp <= contextp->dc_recendp );
-	ASSERT( contextp->dc_nextp < contextp->dc_dataendp );
+	assert( contextp->dc_dataendp <= contextp->dc_recendp );
+	assert( contextp->dc_nextp < contextp->dc_dataendp );
 	contextp->dc_errorpr = BOOL_FALSE;
 
 	mlog( MLOG_NORMAL | MLOG_DRIVE,
@@ -1696,8 +1697,8 @@ do_end_read( drive_t *drivep )
 
 	/* assert protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
 
 	if ( ! contextp->dc_singlethreadedpr ) {
 		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
@@ -1745,9 +1746,9 @@ do_begin_write( drive_t *drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( ! drivep->d_markrecheadp );
-	ASSERT( ! contextp->dc_recp );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( ! drivep->d_markrecheadp );
+	assert( ! contextp->dc_recp );
 
 	/* get pointers into global write header
 	 */
@@ -1758,7 +1759,7 @@ do_begin_write( drive_t *drivep )
 	/* must already be open. The only way to open is to do a begin_read.
 	 * so all interaction with scsi tape requires reading first.
 	 */
-	ASSERT( contextp->dc_fd != -1 );
+	assert( contextp->dc_fd != -1 );
 
 	/* get tape device status. verify tape is positioned
  	 */
@@ -1787,15 +1788,15 @@ do_begin_write( drive_t *drivep )
 	/* get a record buffer. will be used for the media file header,
 	 * and is needed to "prime the pump" for first call to do_write.
 	 */
-	ASSERT( ! contextp->dc_recp );
+	assert( ! contextp->dc_recp );
 	if ( contextp->dc_singlethreadedpr ) {
-		ASSERT( contextp->dc_bufp );
+		assert( contextp->dc_bufp );
 		contextp->dc_recp = contextp->dc_bufp;
 	} else {
-		ASSERT( contextp->dc_ringp );
-		ASSERT( ! contextp->dc_msgp );
+		assert( contextp->dc_ringp );
+		assert( ! contextp->dc_msgp );
 		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
-		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
+		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
 		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
 	}
 
@@ -1840,7 +1841,7 @@ do_begin_write( drive_t *drivep )
 	/* prepare the drive context. must have a record buffer ready to
 	 * go, header initialized.
 	 */
-	ASSERT( ! contextp->dc_ownedp );
+	assert( ! contextp->dc_ownedp );
 	contextp->dc_reccnt = 1; /* count the header record */
 	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
 	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
@@ -1885,15 +1886,15 @@ do_set_mark( drive_t *drivep,
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
 
 	/* calculate and fill in the mark record offset
 	 */
-	ASSERT( contextp->dc_recp );
+	assert( contextp->dc_recp );
 	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
 		  +
 		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
@@ -1908,7 +1909,7 @@ do_set_mark( drive_t *drivep,
 	 */
 	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 	if ( rechdrp->first_mark_offset == -1LL ) {
-		ASSERT( nextoff != -1LL );
+		assert( nextoff != -1LL );
 		rechdrp->first_mark_offset = nextoff;
 	}
 
@@ -1921,7 +1922,7 @@ do_set_mark( drive_t *drivep,
 		drivep->d_markrecheadp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	} else {
-		ASSERT( drivep->d_markrectailp );
+		assert( drivep->d_markrectailp );
 		drivep->d_markrectailp->dm_nextp = markrecp;
 		drivep->d_markrectailp = markrecp;
 	}
@@ -1948,12 +1949,12 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* figure how much is available; supply the min of what is
 	 * available and what is wanted.
@@ -2014,17 +2015,17 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp <= contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp <= contextp->dc_recendp );
 
 	/* verify the caller is returning exactly what is held
 	 */
-	ASSERT( bufp == contextp->dc_ownedp );
-	ASSERT( retcnt == heldcnt );
+	assert( bufp == contextp->dc_ownedp );
+	assert( retcnt == heldcnt );
 
 	/* take it back
 	 */
@@ -2065,7 +2066,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 			rval = contextp->dc_msgp->rm_rval;
 			break;
 		default:
-			ASSERT( 0 );
+			assert( 0 );
 			return DRIVE_ERROR_CORE;
 		}
 	}
@@ -2129,12 +2130,12 @@ do_get_align_cnt( drive_t * drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_errorpr );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_errorpr );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because all buffers are page-aligned
@@ -2144,11 +2145,11 @@ do_get_align_cnt( drive_t * drivep )
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = ( char * )next_alignment_off;
-	ASSERT( next_alignment_point <= contextp->dc_recendp );
+	assert( next_alignment_point <= contextp->dc_recendp );
 
 	/* return the number of bytes to the next alignment offset
 	 */
-	ASSERT( next_alignment_point >= contextp->dc_nextp );
+	assert( next_alignment_point >= contextp->dc_nextp );
 	return ( size_t )( next_alignment_point - contextp->dc_nextp );
 }
 
@@ -2175,12 +2176,12 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_recp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
-	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_recp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
+	assert( contextp->dc_nextp < contextp->dc_recendp );
 
 	/* pre-initialize return of count of bytes committed to media
 	 */
@@ -2222,7 +2223,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 					     contextp->dc_recp,
 					     BOOL_TRUE, BOOL_TRUE );
 		} else {
-			ASSERT( contextp->dc_msgp );
+			assert( contextp->dc_msgp );
 			contextp->dc_msgp->rm_op = RING_OP_WRITE;
 			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
 			Ring_put( contextp->dc_ringp,
@@ -2238,7 +2239,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 				rval = contextp->dc_msgp->rm_rval;
 				break;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2265,7 +2266,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	}
 	if ( ! contextp->dc_singlethreadedpr ) {
 		while ( ! rval ) {
-			ASSERT( contextp->dc_msgp );
+			assert( contextp->dc_msgp );
 			contextp->dc_msgp->rm_op = RING_OP_TRACE;
 			Ring_put( contextp->dc_ringp,
 				  contextp->dc_msgp );
@@ -2277,14 +2278,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 			switch( contextp->dc_msgp->rm_stat ) {
 			case RING_STAT_OK:
 			case RING_STAT_INIT:
-				ASSERT( rval == 0 );
+				assert( rval == 0 );
 				break;
 			case RING_STAT_ERROR:
 				rval = contextp->dc_msgp->rm_rval;
 				first_rec_w_err = contextp->dc_msgp->rm_user;
 				break;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_recp = 0;
 				return DRIVE_ERROR_CORE;
 			}
@@ -2346,11 +2347,11 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * to tape.
 	 */
 	if ( rval ) {
-		ASSERT( first_rec_w_err >= 0 );
+		assert( first_rec_w_err >= 0 );
 		recs_wtn_wo_err = first_rec_w_err;
 		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
 	} else {
-		ASSERT( first_rec_w_err == -1 );
+		assert( first_rec_w_err == -1 );
 		recs_wtn_wo_err = contextp->dc_iocnt;
 		recs_guaranteed = recs_wtn_wo_err;
 	}
@@ -2382,14 +2383,14 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_mode == OM_NONE );
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: fsf: count %d\n",
 	      count );
 
-	ASSERT( count );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( count );
+	assert( contextp->dc_mode == OM_NONE );
 
 	/* get tape status
   	 */
@@ -2426,7 +2427,7 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 			      _("advancing tape to next media file\n") );
 
 			op_failed = 0;
-			ASSERT( contextp->dc_fd >= 0 );
+			assert( contextp->dc_fd >= 0 );
 			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
 				op_failed = 1;
 			}
@@ -2482,7 +2483,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 	      "drive op: bsf: count %d\n",
 	      count );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_mode == OM_NONE );
 
 	*statp = 0;
 
@@ -2515,7 +2516,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 			*statp = DRIVE_ERROR_DEVICE;
 			return 0;
 		}
-		ASSERT( IS_BOT(mtstat ));
+		assert( IS_BOT(mtstat ));
 
 
 		*statp = DRIVE_ERROR_BOM;
@@ -2531,7 +2532,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
 
 	/* back space - places us to left of previous file mark
 	 */
-	ASSERT( drivep->d_capabilities & DRIVE_CAP_BSF );
+	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
 	mtstat = bsf_and_verify( drivep );
 
 	/* check again for beginning-of-tape condition
@@ -2606,8 +2607,8 @@ do_rewind( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: rewind\n" );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
 
 	/* use validating tape rewind util func
 	 */
@@ -2637,8 +2638,8 @@ do_erase( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: erase\n" );
 
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
 
 	/* use validating tape rewind util func
 	 */
@@ -2681,8 +2682,8 @@ do_eject_media( drive_t *drivep )
 
 	/* drive must be open
 	 */
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
 
 	/* issue tape unload
 	 */
@@ -2913,7 +2914,7 @@ read_label( drive_t *drivep )
 	/* if a read error, get status
 	 */
 	if ( nread != ( intgen_t )tape_recsz ) {
-		ASSERT( nread < ( intgen_t )tape_recsz );
+		assert( nread < ( intgen_t )tape_recsz );
 		ok = mt_get_status( drivep, &mtstat );
 		if ( ! ok ) {
 			status_failed_message( drivep );
@@ -3135,10 +3136,10 @@ set_fixed_blksz( drive_t *drivep, size_t blksz )
 
 	/* sanity checks
 	 */
-	ASSERT( blksz );
-	ASSERT( contextp->dc_isvarpr == BOOL_FALSE );
-	ASSERT( contextp->dc_cansetblkszpr );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( blksz );
+	assert( contextp->dc_isvarpr == BOOL_FALSE );
+	assert( contextp->dc_cansetblkszpr );
+	assert( contextp->dc_fd >= 0 );
 
 	/* give it two tries: first without rewinding, second with rewinding
 	 */
@@ -3213,7 +3214,7 @@ get_tpcaps( drive_t *drivep )
 {
 	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 
 	if ( contextp->dc_isrmtpr ) {
 		/* can't ask about blksz, can't set blksz, can't ask about
@@ -3386,7 +3387,7 @@ mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
 	mop.mt_op   	= (short )sub_op;
 	mop.mt_count	= param;
 
-	ASSERT( fd >= 0 );
+	assert( fd >= 0 );
 
 	switch ( sub_op ) {
 	case MTSEEK:
@@ -3458,7 +3459,7 @@ mt_get_fileno( drive_t *drivep, long *fileno)
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: get fileno\n" );
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 
 	if ( ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0 ) {
 		/* failure
@@ -3491,7 +3492,7 @@ mt_get_status( drive_t *drivep, long *status)
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: get status\n" );
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 
 	if (TS_ISDRIVER) {
 		/*
@@ -3864,7 +3865,7 @@ retry:
 
 	/* shouldn't be here if drive is open
 	 */
-	ASSERT( contextp->dc_fd == -1 );
+	assert( contextp->dc_fd == -1 );
 
 	mlog( MLOG_VERBOSE | MLOG_DRIVE,
 	      _("preparing drive\n") );
@@ -3966,7 +3967,7 @@ retry:
 
 		Close( drivep );
 	}
-	ASSERT( IS_ONL( mtstat ));
+	assert( IS_ONL( mtstat ));
 
 	/* determine tape capabilities. this will set the drivep->d_capabilities
 	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
@@ -4156,7 +4157,7 @@ retry:
 			      contextp->dc_recp,
 			      tape_recsz,
 			      &saved_errno );
-		ASSERT( saved_errno == 0 || nread < 0 );
+		assert( saved_errno == 0 || nread < 0 );
 
 		/* RMT can require a retry
 		 */
@@ -4536,7 +4537,7 @@ checkhdr:
 			rec_hdr_t *tprhdrp;
 			drhdrp = drivep->d_readhdrp;
 			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
-			ASSERT( tprhdrp->recsize >= 0 );
+			assert( tprhdrp->recsize >= 0 );
 			tape_recsz = ( size_t )tprhdrp->recsize;
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			      "tape record size set to header's "
@@ -4657,7 +4658,7 @@ Open( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: opening drive\n" );
 
-	ASSERT( contextp->dc_fd == -1 );
+	assert( contextp->dc_fd == -1 );
 
 	errno = 0;
 	contextp->dc_fd = open( drivep->d_pathname, oflags );
@@ -4678,7 +4679,7 @@ Close( drive_t *drivep )
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: closing drive\n" );
 
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_fd >= 0 );
 
 	( void )close( contextp->dc_fd );
 
@@ -4695,8 +4696,8 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	      "tape op: reading %u bytes\n",
 	      cnt );
 
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( bufp );
+	assert( contextp->dc_fd >= 0 );
+	assert( bufp );
 	*errnop = 0;
 	errno = 0;
 	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
@@ -4731,8 +4732,8 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	      "tape op: writing %u bytes\n",
 	      cnt );
 
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( bufp );
+	assert( contextp->dc_fd >= 0 );
+	assert( bufp );
 	*errnop = 0;
 	errno = 0;
 	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
@@ -4944,7 +4945,7 @@ read_record(  drive_t *drivep, char *bufp )
 	/* short read
 	 */
 	if ( nread >= 0 ) {
-		ASSERT( nread <= ( intgen_t )tape_recsz );
+		assert( nread <= ( intgen_t )tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
@@ -5006,7 +5007,7 @@ getrec( drive_t *drivep )
 				contextp->dc_errorpr = BOOL_TRUE;
 				return contextp->dc_msgp->rm_rval;
 			default:
-				ASSERT( 0 );
+				assert( 0 );
 				contextp->dc_errorpr = BOOL_TRUE;
 				return DRIVE_ERROR_CORE;
 			}
@@ -5019,7 +5020,7 @@ getrec( drive_t *drivep )
 		contextp->dc_nextp = contextp->dc_recp
 				     +
 				     STAPE_HDR_SZ;
-		ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
+		assert( contextp->dc_nextp <= contextp->dc_dataendp );
 	}
 
 	return 0;
@@ -5055,7 +5056,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 	}
 
 	rval = determine_write_error( drivep, nwritten, saved_errno );
-	ASSERT( rval );
+	assert( rval );
 
 	return rval;
 }
@@ -5094,7 +5095,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
 	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 	      "ring op: reset\n" );
 	
-	ASSERT( ringp );
+	assert( ringp );
 
 	ring_reset( ringp, msgp );
 }
@@ -5125,19 +5126,19 @@ display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
 	char *bufszsfxp;
 	
 	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
-		ASSERT( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
+		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
 		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
-		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
+		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
 		bufszsfxp = "KB";
 	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
-		ASSERT( ! ( STAPE_MAX_RECSZ % 0x100000 ));
+		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
 		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
-		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
+		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
 		bufszsfxp = "MB";
 	} else if ( tape_recsz == STAPE_MAX_LINUX_RECSZ ) {
-		ASSERT( ! ( STAPE_MAX_LINUX_RECSZ % 0x100000 ));
+		assert( ! ( STAPE_MAX_LINUX_RECSZ % 0x100000 ));
 		sprintf( bufszbuf, "%u", STAPE_MAX_LINUX_RECSZ / 0x100000 );
-		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
+		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
 		bufszsfxp = "MB";
 	} else {
 		bufszsfxp = "";
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 2b0447d..2e57d8c 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <malloc.h>
 #include <sched.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -185,7 +186,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 
 	/* sanity checks
 	 */
-	ASSERT( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
+	assert( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
 
 	/* determine if this is an rmt file. if so, give a weak match:
 	 * might be an ordinary file accessed via the rmt protocol.
@@ -234,8 +235,8 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 	 */
 	contextp = ( drive_context_t * )memalign( PGSZ,
 						  sizeof( drive_context_t ));
-	ASSERT( contextp );
-	ASSERT( ( void * )contextp->dc_buf == ( void * )contextp );
+	assert( contextp );
+	assert( ( void * )contextp->dc_buf == ( void * )contextp );
 	memset( ( void * )contextp, 0, sizeof( *contextp ));
 
 	/* scan drive device pathname to see if remote tape
@@ -439,9 +440,9 @@ do_begin_read( drive_t *drivep )
 
 	/* verify protocol being followed
 	 */
-	ASSERT( dcaps & DRIVE_CAP_READ );
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( dcaps & DRIVE_CAP_READ );
+	assert( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
 
 	/* can only read one media file
 	 */
@@ -484,7 +485,7 @@ do_begin_read( drive_t *drivep )
 		free(tmphdr);
 		return rval;
 	}
-	ASSERT( ( size_t )nread == GLOBAL_HDR_SZ );
+	assert( ( size_t )nread == GLOBAL_HDR_SZ );
 	
 	mlog(MLOG_NITTY, "do_begin_read: global_hdr\n"
 	     "\tgh_magic %.100s\n"
@@ -585,9 +586,9 @@ do_read( drive_t *drivep,
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( wantedcnt > 0 );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
+	assert( wantedcnt > 0 );
 
 	/* pre-initialize reference return
 	 */
@@ -595,7 +596,7 @@ do_read( drive_t *drivep,
 
 	/* count number of unread bytes in buffer
 	 */
-	ASSERT( contextp->dc_emptyp >= contextp->dc_nextp );
+	assert( contextp->dc_emptyp >= contextp->dc_nextp );
 	remainingcnt = ( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
 
 	/* if no unread bytes in buffer, refill
@@ -628,7 +629,7 @@ do_read( drive_t *drivep,
 		/* record the ptrs to the first empty byte and the next
 		 * byte to be read
 		 */
-		ASSERT( nread <= BUFSZ );
+		assert( nread <= BUFSZ );
 		contextp->dc_emptyp = contextp->dc_buf + nread;
 		contextp->dc_nextp = contextp->dc_buf;
 
@@ -656,7 +657,7 @@ do_read( drive_t *drivep,
 	/* advance the next ptr to the next byte to be supplied
 	 */
 	contextp->dc_nextp += actualcnt;
-	ASSERT( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert( contextp->dc_nextp <= contextp->dc_emptyp );
 
 	/* return the actual number of bytes supplied, and a ptr to the first
 	 */
@@ -681,17 +682,17 @@ do_return_read_buf( drive_t *drivep, char *retp, size_t retcnt )
 
 	/* verify protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( contextp->dc_ownedp );
 
 	/* verify returning right buffer
 	 */
-	ASSERT( retp == contextp->dc_ownedp );
+	assert( retp == contextp->dc_ownedp );
 
 	/* verify all of buffer provided is being returned
 	 */
 	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
-	ASSERT( retcnt == ownedcnt );
+	assert( retcnt == ownedcnt );
 
 	/* indicate nothing now owned by caller
 	 */
@@ -713,8 +714,8 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
 
 	/* calculate the offset of the next byte to be supplied relative to
 	 * the beginning of the buffer and relative to the beginning of
@@ -746,8 +747,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
 
 	/* calculate the current offset within the media file
 	 * of the next byte to be read
@@ -784,7 +785,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 */
 	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
 	strmoff = contextp->dc_bufstroff + nextoff;
-	ASSERT( strmoff == mark );
+	assert( strmoff == mark );
 
 	return 0;
 }
@@ -808,9 +809,9 @@ do_next_mark( drive_t *drivep )
 
 	/* assert protocol
 	 */
-	ASSERT( dcaps & DRIVE_CAP_NEXTMARK );
-	ASSERT( contextp->dc_mode == OM_READ );
-	ASSERT( ! contextp->dc_ownedp );
+	assert( dcaps & DRIVE_CAP_NEXTMARK );
+	assert( contextp->dc_mode == OM_READ );
+	assert( ! contextp->dc_ownedp );
 
 	if ( ! mark ) {
 		return DRIVE_ERROR_EOF;
@@ -837,13 +838,13 @@ do_end_read( drive_t *drivep )
 
 	/* be sure we are following protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_READ );
+	assert( contextp->dc_mode == OM_READ );
 	contextp->dc_mode = OM_NONE;
 
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	ASSERT( contextp->dc_fmarkcnt == 1 );
+	assert( contextp->dc_fmarkcnt == 1 );
 }
 
 /* begin_write - prepare file for writing
@@ -871,12 +872,12 @@ do_begin_write( drive_t *drivep )
 
 	/* sanity checks
 	 */
-	ASSERT( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
+	assert( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_fd >= 0 );
-	ASSERT( contextp->dc_mode == OM_NONE );
+	assert( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
 
 	/* only one media file may be written
 	 */
@@ -918,7 +919,7 @@ do_begin_write( drive_t *drivep )
 	contextp->dc_mode = OM_WRITE;
 
 	tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
-	ASSERT(tmphdr);
+	assert(tmphdr);
 	memset(tmphdr, 0, GLOBAL_HDR_SZ);
 	tmpdh = (drive_hdr_t *)tmphdr->gh_upper;
 	tmpmh = (media_hdr_t *)tmpdh->dh_upper;
@@ -997,9 +998,9 @@ do_set_mark( drive_t *drivep,
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_nextp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_nextp );
 
 	/* calculate the mark offset
 	 */
@@ -1053,7 +1054,7 @@ do_set_mark( drive_t *drivep,
 
 			/* assert the header has been flushed
 			 */
-			ASSERT( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
+			assert( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
 
 			/* record mark in hdr
 			 */
@@ -1082,7 +1083,7 @@ do_set_mark( drive_t *drivep,
 				content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
 				content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
 
-				ASSERT( newoff == 0 );
+				assert( newoff == 0 );
 
 				/* write and seek back to current offset
 				 */
@@ -1092,7 +1093,7 @@ do_set_mark( drive_t *drivep,
 				     "(on media)\n" );
 
 				tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
-				ASSERT(tmphdr);
+				assert(tmphdr);
 				tmpdh = (drive_hdr_t *)tmphdr->gh_upper;
 				tmpmh = (media_hdr_t *)tmpdh->dh_upper;
 				tmpch = (content_hdr_t *)tmpmh->mh_upper;
@@ -1129,13 +1130,13 @@ do_set_mark( drive_t *drivep,
 				nwritten = write( contextp->dc_fd,
 						  tmphdr,
 						  sizeof( *tmphdr ));
-				ASSERT( ( size_t )nwritten == sizeof( *tmphdr ));
+				assert( ( size_t )nwritten == sizeof( *tmphdr ));
 				free(tmphdr);
 
 				newoff = lseek64( contextp->dc_fd,
 						  contextp->dc_bufstroff,
 						  SEEK_SET );
-				ASSERT( newoff == contextp->dc_bufstroff );
+				assert( newoff == contextp->dc_bufstroff );
 			}
 		}
 	}
@@ -1144,7 +1145,7 @@ do_set_mark( drive_t *drivep,
 	 * otherwise put the mark record on the tail of the queue.
 	 */
 	if ( contextp->dc_nextp == contextp->dc_buf ) {
-		ASSERT( drivep->d_markrecheadp == 0 );
+		assert( drivep->d_markrecheadp == 0 );
 		( * cbfuncp )( cbcontextp, markrecp, BOOL_TRUE );
 		return;
 	} else {
@@ -1155,7 +1156,7 @@ do_set_mark( drive_t *drivep,
 			drivep->d_markrecheadp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		} else {
-			ASSERT( drivep->d_markrectailp );
+			assert( drivep->d_markrectailp );
 			drivep->d_markrectailp->dm_nextp = markrecp;
 			drivep->d_markrectailp = markrecp;
 		}
@@ -1180,11 +1181,11 @@ do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
-	ASSERT( contextp->dc_ownedsz == 0 );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_emptyp );
+	assert( contextp->dc_ownedsz == 0 );
 
 	/* calculate how much buffer remains
 	 */
@@ -1237,18 +1238,18 @@ do_write( drive_t *drivep, char *bufp, size_t writesz )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( contextp->dc_ownedp );
-	ASSERT( bufp == contextp->dc_ownedp );
-	ASSERT( ! contextp->dc_nextp );
-	ASSERT( contextp->dc_ownedp < contextp->dc_emptyp );
-	ASSERT( writesz == contextp->dc_ownedsz );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( contextp->dc_ownedp );
+	assert( bufp == contextp->dc_ownedp );
+	assert( ! contextp->dc_nextp );
+	assert( contextp->dc_ownedp < contextp->dc_emptyp );
+	assert( writesz == contextp->dc_ownedsz );
 
 	/* calculate next portion of buffer available for get_write_buf,
 	 * and indicate no portion is owned.
 	 */
 	contextp->dc_nextp = contextp->dc_ownedp + writesz;
-	ASSERT( contextp->dc_nextp <= contextp->dc_emptyp );
+	assert( contextp->dc_nextp <= contextp->dc_emptyp );
 	contextp->dc_ownedp = 0;
 	contextp->dc_ownedsz = 0;
 
@@ -1304,10 +1305,10 @@ do_get_align_cnt( drive_t *drivep )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_emptyp );
 
 	/* calculate the next alignment point at or beyond the current nextp.
 	 * the following algorithm works because dc_buf is page-aligned and
@@ -1317,7 +1318,7 @@ do_get_align_cnt( drive_t *drivep )
 	next_alignment_off +=  PGMASK;
 	next_alignment_off &= ~PGMASK;
 	next_alignment_point = ( char * )next_alignment_off;
-	ASSERT( next_alignment_point <= contextp->dc_emptyp );
+	assert( next_alignment_point <= contextp->dc_emptyp );
 
 	/* return the number of bytes to the next alignment point
 	 */
@@ -1338,14 +1339,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_WRITE );
-	ASSERT( ! contextp->dc_ownedp );
-	ASSERT( contextp->dc_nextp );
-	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
+	assert( contextp->dc_mode == OM_WRITE );
+	assert( ! contextp->dc_ownedp );
+	assert( contextp->dc_nextp );
+	assert( contextp->dc_nextp < contextp->dc_emptyp );
 
 	/* calculate length of un-written portion of buffer
 	 */
-	ASSERT( contextp->dc_nextp >= contextp->dc_buf );
+	assert( contextp->dc_nextp >= contextp->dc_buf );
 	remaining_bufsz = ( size_t )( contextp->dc_nextp - contextp->dc_buf );
 
 	if ( remaining_bufsz ) {
@@ -1387,7 +1388,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	/* bump the file mark cnt
 	 */
 	contextp->dc_fmarkcnt++;
-	ASSERT( contextp->dc_fmarkcnt == 1 );
+	assert( contextp->dc_fmarkcnt == 1 );
 
 	*ncommittedp = contextp->dc_bufstroff;
 	contextp->dc_mode = OM_NONE;
@@ -1410,15 +1411,15 @@ do_rewind( drive_t *drivep )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( dcaps & DRIVE_CAP_REWIND );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( dcaps & DRIVE_CAP_REWIND );
+	assert( contextp->dc_fd >= 0 );
 
 	/* seek to beginning of file
 	 */
 	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
 	if ( newoff ) {
-		ASSERT( newoff < 0 );
+		assert( newoff < 0 );
 		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s: %s\n"),
 		      drivep->d_pathname,
@@ -1446,15 +1447,15 @@ do_erase( drive_t *drivep )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( dcaps & DRIVE_CAP_ERASE );
-	ASSERT( contextp->dc_fd >= 0 );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( dcaps & DRIVE_CAP_ERASE );
+	assert( contextp->dc_fd >= 0 );
 
 	/* seek to beginning of file
 	 */
 	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
 	if ( newoff ) {
-		ASSERT( newoff < 0 );
+		assert( newoff < 0 );
 		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
 		      _("could not rewind %s in prep for erase: %s\n"),
 		      drivep->d_pathname,
@@ -1486,7 +1487,7 @@ do_get_device_class( drive_t *drivep )
 {
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple get_device_class( )\n" );
-	ASSERT( drivep );
+	assert( drivep );
 	return DEVICE_NONREMOVABLE;
 }
 
@@ -1500,8 +1501,8 @@ do_quit( drive_t *drivep )
 
 	/* assert protocol
 	 */
-	ASSERT( contextp->dc_mode == OM_NONE );
-	ASSERT( contextp );
+	assert( contextp->dc_mode == OM_NONE );
+	assert( contextp );
 
 	/* close file
 	 */
diff --git a/common/fs.c b/common/fs.c
index 6f4cb6c..b77f6cc 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -27,6 +27,7 @@
 #include <fcntl.h>
 #include <mntent.h>
 #include <sys/ioctl.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -127,11 +128,11 @@ fs_info( char *typb,		/* out */
 	if ( canstat && ( statb.st_mode & S_IFMT ) == S_IFBLK ) {
 		if ( ( tep = fs_tab_lookup_blk( usrs )) != 0 ) {
 			blks = tep->fte_blks;
-			ASSERT( strlen( blks ) < ( size_t )blkbz );
+			assert( strlen( blks ) < ( size_t )blkbz );
 			strcpy( blkb, blks );
 			mnts = tep->fte_mnts;
 			if ( mnts ) {
-				ASSERT( strlen( mnts ) < ( size_t )mntbz );
+				assert( strlen( mnts ) < ( size_t )mntbz );
 				strcpy( mntb, mnts );
 			} else {
 				mntb[ 0 ] = 0;
@@ -139,7 +140,7 @@ fs_info( char *typb,		/* out */
 			if ( ( typs = tep->fte_typs ) == 0 ) {
 				typs = typd;
 			}
-			ASSERT( strlen( typs ) < ( size_t )typbz );
+			assert( strlen( typs ) < ( size_t )typbz );
 			strcpy( typb, typs );
 			ok = BOOL_TRUE;
 		} else {
@@ -147,13 +148,13 @@ fs_info( char *typb,		/* out */
 		}
 	} else if ( ( tep = fs_tab_lookup_mnt( usrs )) != 0 ) {
 		blks = tep->fte_blks;
-		ASSERT( strlen( blks ) < ( size_t )blkbz );
+		assert( strlen( blks ) < ( size_t )blkbz );
 		strcpy( blkb, blks );
 		mnts = tep->fte_mnts;
-		ASSERT( strlen( mnts ) < ( size_t )mntbz );
+		assert( strlen( mnts ) < ( size_t )mntbz );
 		strcpy( mntb, mnts );
 		typs = tep->fte_typs;
-		ASSERT( strlen( typs ) < ( size_t )typbz );
+		assert( strlen( typs ) < ( size_t )typbz );
 		strcpy( typb, typs );
 		ok = BOOL_TRUE;
 	} else {
@@ -161,7 +162,7 @@ fs_info( char *typb,		/* out */
 	}
 
 	fs_tab_free( );
-	ASSERT( ok != BOOL_UNKNOWN );
+	assert( ok != BOOL_UNKNOWN );
 
 	if ( ok == BOOL_TRUE ) {
 		intgen_t rval = fs_getid( mntb, idb );
@@ -281,11 +282,11 @@ fs_tab_ent_build( struct mntent *mntentp )
 	char *cp;
 
 	tep = ( fs_tab_ent_t * )calloc( 1, sizeof( fs_tab_ent_t ));
-	ASSERT( tep );
+	assert( tep );
 
 	if ( mntentp->mnt_dir ) {
 		cp = calloc( 1, strlen( mntentp->mnt_dir ) + 1 );
-		ASSERT( cp );
+		assert( cp );
 		( void )strcpy( cp, mntentp->mnt_dir );
 		tep->fte_mnts = cp;
 	} else {
@@ -294,7 +295,7 @@ fs_tab_ent_build( struct mntent *mntentp )
 
 	if ( mntentp->mnt_type ) {
 		cp = calloc( 1, strlen( mntentp->mnt_type ) + 1 );
-		ASSERT( cp );
+		assert( cp );
 		( void )strcpy( cp, mntentp->mnt_type );
 		tep->fte_typs = cp;
 	} else {
@@ -303,7 +304,7 @@ fs_tab_ent_build( struct mntent *mntentp )
 
 	if ( mntentp->mnt_fsname ) {
 		cp = calloc( 1, strlen( mntentp->mnt_fsname ) + 1 );
-		ASSERT( cp );
+		assert( cp );
 		( void )strcpy( cp, mntentp->mnt_fsname );
 		tep->fte_blks = cp;
 	} else {
diff --git a/common/global.c b/common/global.c
index 8e49d8b..ed844cc 100644
--- a/common/global.c
+++ b/common/global.c
@@ -22,6 +22,7 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <errno.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -67,13 +68,13 @@ global_hdr_alloc( intgen_t argc, char *argv[ ] )
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( time32_t ) == GLOBAL_HDR_TIME_SZ );
-	ASSERT( sizeof( uuid_t ) == GLOBAL_HDR_UUID_SZ );
+	assert( sizeof( time32_t ) == GLOBAL_HDR_TIME_SZ );
+	assert( sizeof( uuid_t ) == GLOBAL_HDR_UUID_SZ );
 
 	/* allocate a global hdr
 	 */
 	ghdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
-	ASSERT( ghdrp );
+	assert( ghdrp );
 
 	/* fill in the magic number
 	 */
@@ -326,7 +327,7 @@ prompt_label( char *bufp, size_t bufsz )
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	responseix = dlog_string_query( prompt_label_cb,
@@ -348,7 +349,7 @@ prompt_label( char *bufp, size_t bufsz )
 		ackstr[ ackcnt++ ] = _("session label left blank\n");
 	}
 
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_string_ack( ackstr,
 			 ackcnt );
 
@@ -357,7 +358,7 @@ prompt_label( char *bufp, size_t bufsz )
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 7f9b45e..0bca9ff 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <attr/attributes.h>
 #include <xfs/jdm.h>
+#include <assert.h>
 
 #include "hsmapi.h"
 #include "mlog.h"
diff --git a/common/inventory.c b/common/inventory.c
index fb27048..681d28f 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -27,6 +27,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <assert.h>
 
 #include "types.h"
 #include "inventory_priv.h"
@@ -51,7 +52,7 @@ inv_open( inv_predicate_t bywhat, void *pred )
 	
 	int index = 0;
 	
-	ASSERT ( pred );
+	assert ( pred );
 	if ((fd = init_idb ( pred, bywhat, uuname, &tok )) < 0 )
 		return tok;
 
@@ -66,7 +67,7 @@ inv_open( inv_predicate_t bywhat, void *pred )
 		return INV_TOKEN_NULL;
 	}
 
-	ASSERT ( index > 0 );
+	assert ( index > 0 );
 
 	/* Now we need to make sure that this has enough space */
 	num = GET_SESCOUNTERS( stobjfd, &sescnt );
@@ -145,7 +146,7 @@ inv_lasttime_level_lessthan(
 	time32_t **tm )
 {
 	int 	rval;
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 
 	rval =  search_invt( tok, level, (void **) tm,
 			 (search_callback_t) tm_level_lessthan );
@@ -170,7 +171,7 @@ inv_lastsession_level_lessthan(
 	inv_session_t 	**ses )
 {
 	int 	rval;
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 
 	rval = search_invt( tok, level, (void **) ses, 
 			  (search_callback_t) lastsess_level_lessthan );
@@ -197,7 +198,7 @@ inv_lastsession_level_equalto(
 	inv_session_t	**ses )
 {
 	int 	rval;
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 	rval = search_invt( tok, level, (void **) ses, 
 			  (search_callback_t) lastsess_level_equalto );
 
@@ -236,8 +237,8 @@ inv_writesession_open(
 	invt_seshdr_t  	hdr;
 	inv_sestoken_t	sestok;
 
-	ASSERT ( tok != INV_TOKEN_NULL );
-	ASSERT ( sesid && fsid && mntpt && devpath );
+	assert ( tok != INV_TOKEN_NULL );
+	assert ( sesid && fsid && mntpt && devpath );
 
 	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
 		if ( put_fstab_entry( fsid, mntpt, devpath ) < 0 ) {
@@ -264,7 +265,7 @@ inv_writesession_open(
 
 	fd = tok->d_stobj_fd;
 	
-	ASSERT ( fd > 0 );
+	assert ( fd > 0 );
 
 	hdr.sh_time = time;
 	hdr.sh_level = level;	
@@ -286,7 +287,7 @@ inv_writesession_open(
 	/* create the writesession, and get ready for the streams to come 
 	   afterwards */
 	rval = create_session( sestok, fd, sescnt, ses, &hdr );
-	ASSERT (rval > 0);
+	assert (rval > 0);
 
 
 	INVLOCK( fd, LOCK_UN );
@@ -324,7 +325,7 @@ inv_writesession_close( inv_sestoken_t tok )
 {
 	int		rval;
 	
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 
 	/* now update end_time in the inv index header */
 	rval = put_sesstime( tok, INVT_ENDTIME );
@@ -354,7 +355,7 @@ inv_stream_open(
 	invt_seshdr_t  seshdr;
 	int fd;
 
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 	 
 	stream.st_nmediafiles = 0;
 	stream.st_interrupted = BOOL_FALSE;
@@ -505,9 +506,9 @@ inv_put_mediafile(
 	int 		 rval;
 
 
-	ASSERT ( tok != INV_TOKEN_NULL );
-	ASSERT ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
-	ASSERT ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
+	assert ( tok != INV_TOKEN_NULL );
+	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
+	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
 
 	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
 	
@@ -627,8 +628,8 @@ inv_get_session(
 	void		      **bufpp,	/* buf to fill */
 	size_t		       *bufszp )/* size of that buffer */
 {
-	ASSERT( tok != INV_TOKEN_NULL );
-	ASSERT( tok->sd_invtok );
+	assert( tok != INV_TOKEN_NULL );
+	assert( tok->sd_invtok );
 
 	/* First get the session header, and the session information. Then
 	   we can figure out how much space to allocate */
diff --git a/common/lock.c b/common/lock.c
index ab5b210..347f6cd 100644
--- a/common/lock.c
+++ b/common/lock.c
@@ -18,6 +18,7 @@
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
+#include <assert.h>
 
 #include "types.h"
 #include "qlock.h"
@@ -30,7 +31,7 @@ lock_init( void )
 {
 	/* initialization sanity checks
 	 */
-	ASSERT( lock_qlockh == QLOCKH_NULL );
+	assert( lock_qlockh == QLOCKH_NULL );
 
 	/* allocate a qlock
 	 */
diff --git a/common/main.c b/common/main.c
index 8e7451f..f392856 100644
--- a/common/main.c
+++ b/common/main.c
@@ -33,6 +33,7 @@
 #include <stdint.h>
 #include <sched.h>
 #include <pthread.h>
+#include <assert.h>
 
 #include "exit.h"
 #include "types.h"
@@ -161,14 +162,14 @@ main( int argc, char *argv[] )
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( char_t ) == 1 );
-	ASSERT( sizeof( u_char_t ) == 1 );
-	ASSERT( sizeof( int32_t ) == 4 );
-	ASSERT( sizeof( u_int32_t ) == 4 );
-	ASSERT( sizeof( size32_t ) == 4 );
-	ASSERT( sizeof( int64_t ) == 8 );
-	ASSERT( sizeof( u_int64_t ) == 8 );
-	ASSERT( sizeof( size64_t ) == 8 );
+	assert( sizeof( char_t ) == 1 );
+	assert( sizeof( u_char_t ) == 1 );
+	assert( sizeof( int32_t ) == 4 );
+	assert( sizeof( u_int32_t ) == 4 );
+	assert( sizeof( size32_t ) == 4 );
+	assert( sizeof( int64_t ) == 8 );
+	assert( sizeof( u_int64_t ) == 8 );
+	assert( sizeof( size64_t ) == 8 );
 
 	/* record the command name used to invoke
 	 */
@@ -365,7 +366,7 @@ main( int argc, char *argv[] )
 	mlog( MLOG_DEBUG | MLOG_PROC,
 	      "getpagesize( ) returns %u\n",
 	      pgsz );
-	ASSERT( ( intgen_t )pgsz > 0 );
+	assert( ( intgen_t )pgsz > 0 );
 	pgmask = pgsz - 1;
 
 	/* report parent tid
@@ -792,7 +793,7 @@ main( int argc, char *argv[] )
 			mlog_exit_hint(RV_INTR);
 			stop_in_progress = BOOL_TRUE;
 			cldmgr_stop( );
-			ASSERT( stop_timeout >= 0 );
+			assert( stop_timeout >= 0 );
 			stop_deadline = now + ( time32_t )stop_timeout;
 		}
 		
@@ -1146,7 +1147,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 				return BOOL_FALSE;
 			}
 			optfilename = optarg;
-			ASSERT( optind > 2 );
+			assert( optind > 2 );
 			optfileix = ( ix_t )optind - 2;
 			break;
 		}
@@ -1211,7 +1212,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* allocate an argument buffer
 	 */
 	argbuf = ( char * )malloc( sz );
-	ASSERT( argbuf );
+	assert( argbuf );
 
 	/* copy arg0 (the executable's name ) in first
 	 */
@@ -1233,7 +1234,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 		close( fd );
 		return BOOL_FALSE;
 	}
-	ASSERT( ( off64_t )nread == stat.st_size );
+	assert( ( off64_t )nread == stat.st_size );
 	p += ( size_t )stat.st_size;
 	*p++ = ' ';
 
@@ -1251,7 +1252,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* null-terminate the entire buffer
 	 */
 	*p++ = 0;
-	ASSERT( ( size_t )( p - argbuf ) <= sz );
+	assert( ( size_t )( p - argbuf ) <= sz );
 
 	/* change newlines and carriage returns into spaces
 	 */
@@ -1303,7 +1304,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* allocate a new argv array to hold the tokens
 	 */
 	newargv = ( char ** )calloc( tokencnt, sizeof( char * ));
-	ASSERT( newargv );
+	assert( newargv );
 
 	/* null-terminate tokens and place in new argv, after
 	 * extracting quotes and escapes
@@ -1326,7 +1327,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 
 		/* better not disagree with counting scan!
 		 */
-		ASSERT( i < ( intgen_t )tokencnt );
+		assert( i < ( intgen_t )tokencnt );
 
 		/* find the end of the first token
 		 */
@@ -1533,7 +1534,7 @@ sigint_dialog( void )
 			_("\nsession interrupt in progress\n");
 	}
 	preamblestr[ preamblecnt++ ] = "\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* top-level query: a function of session interrupt status
@@ -1541,7 +1542,7 @@ sigint_dialog( void )
 	querycnt = 0;
 	querystr[ querycnt++ ] = _("please select one of "
 				 "the following operations\n");
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	if ( ! stop_in_progress ) {
 		interruptix = choicecnt;
@@ -1564,7 +1565,7 @@ sigint_dialog( void )
 	choicestr[ choicecnt++ ] = _("other controls");
 	continueix = choicecnt;
 	choicestr[ choicecnt++ ] = _("continue");
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 
 	responseix = dlog_multi_query( querystr,
 				       querycnt,
@@ -1586,13 +1587,13 @@ sigint_dialog( void )
 				ackcnt );
 		querycnt = 0;
 		querystr[ querycnt++ ] = _("please confirm\n");
-		ASSERT( querycnt <= QUERYMAX );
+		assert( querycnt <= QUERYMAX );
 		choicecnt = 0;
 		interruptix = choicecnt;
 		choicestr[ choicecnt++ ] = _("interrupt this session");
 		nochangeix = choicecnt;
 		choicestr[ choicecnt++ ] = _("continue");
-		ASSERT( choicecnt <= CHOICEMAX );
+		assert( choicecnt <= CHOICEMAX );
 		responseix = dlog_multi_query( querystr,
 					       querycnt,
 					       choicestr,
@@ -1623,7 +1624,7 @@ sigint_dialog( void )
 		querycnt = 0;
 		querystr[ querycnt++ ] = _("please select one of "
 					 "the following subsystems\n");
-		ASSERT( querycnt <= QUERYMAX );
+		assert( querycnt <= QUERYMAX );
 		choicecnt = 0;
 		/* number of lines must match number of subsystems
 		 */
@@ -1634,7 +1635,7 @@ sigint_dialog( void )
 		choicestr[ choicecnt++ ] = _("all of the above");
 		nochangeix = choicecnt;
 		choicestr[ choicecnt++ ] = _("no change");
-		ASSERT( choicecnt <= CHOICEMAX );
+		assert( choicecnt <= CHOICEMAX );
 		responseix = dlog_multi_query( querystr,
 					       querycnt,
 					       choicestr,
@@ -1664,7 +1665,7 @@ sigint_dialog( void )
 			querycnt = 0;
 			querystr[ querycnt++ ] = ("please select one of the "
 						  "following verbosity levels\n");
-			ASSERT( querycnt <= QUERYMAX );
+			assert( querycnt <= QUERYMAX );
 			choicecnt = 0;
 			choicestr[ choicecnt++ ] = _("silent");
 			choicestr[ choicecnt++ ] = _("verbose");
@@ -1674,7 +1675,7 @@ sigint_dialog( void )
 			choicestr[ choicecnt++ ] = _("nitty + 1");
 			nochangeix = choicecnt;
 			choicestr[ choicecnt++ ] = _("no change");
-			ASSERT( choicecnt <= CHOICEMAX );
+			assert( choicecnt <= CHOICEMAX );
 			responseix = dlog_multi_query( querystr,
 						       querycnt,
 						       choicestr,
@@ -1708,7 +1709,7 @@ sigint_dialog( void )
 			} else {
 				if ( ssselected < 0 ) {
 					ix_t ssix;
-					ASSERT( ssselected == -1 );
+					assert( ssselected == -1 );
 					for ( ssix = 0
 					      ;
 					      ssix < MLOG_SS_CNT
@@ -1734,7 +1735,7 @@ sigint_dialog( void )
 		querycnt = 0;
 		querystr[ querycnt++ ] = _("please select one of "
 					  "the following metrics\n");
-		ASSERT( querycnt <= QUERYMAX );
+		assert( querycnt <= QUERYMAX );
 		choicecnt = 0;
 		ioix = choicecnt;
 		choicestr[ choicecnt++ ] = _("I/O");
@@ -1746,7 +1747,7 @@ sigint_dialog( void )
 #endif /* RESTORE */
 		nochangeix = choicecnt;
 		choicestr[ choicecnt++ ] = _("continue");
-		ASSERT( choicecnt <= CHOICEMAX );
+		assert( choicecnt <= CHOICEMAX );
 		responseix = dlog_multi_query( querystr,
 					       querycnt,
 					       choicestr,
@@ -1779,11 +1780,11 @@ sigint_dialog( void )
 		if ( responseix != nochangeix ) {
 			querycnt = 0;
 			querystr[ querycnt++ ] = "\n";
-			ASSERT( querycnt <= QUERYMAX );
+			assert( querycnt <= QUERYMAX );
 			choicecnt = 0;
 			nochangeix = choicecnt;
 			choicestr[ choicecnt++ ] = _("continue");
-			ASSERT( choicecnt <= CHOICEMAX );
+			assert( choicecnt <= CHOICEMAX );
 			responseix = dlog_multi_query( querystr,
 						       querycnt,
 						       choicestr,
@@ -1818,7 +1819,7 @@ sigint_dialog( void )
 		querycnt = 0;
 		querystr[ querycnt++ ] = _("please select one of "
 					   "the following controls\n");
-		ASSERT( querycnt <= QUERYMAX );
+		assert( querycnt <= QUERYMAX );
 		choicecnt = 0;
 		progix = choicecnt;
 		if ( progrpt_enabledpr ) {
@@ -1847,7 +1848,7 @@ sigint_dialog( void )
 		}
 		nochangeix = choicecnt;
 		choicestr[ choicecnt++ ] = _("continue");
-		ASSERT( choicecnt <= CHOICEMAX );
+		assert( choicecnt <= CHOICEMAX );
 		responseix = dlog_multi_query( querystr,
 					       querycnt,
 					       choicestr,
@@ -1898,7 +1899,7 @@ sigint_dialog( void )
 							sprintf( intervalbuf,
 								 _("%d seconds\n"),
 								 newinterval );
-							ASSERT( strlen( intervalbuf )
+							assert( strlen( intervalbuf )
 								<
 								sizeof( intervalbuf ));
 							ackstr[ ackcnt++ ] = intervalbuf;
@@ -1911,7 +1912,7 @@ sigint_dialog( void )
 						sprintf( intervalbuf,
 							 _("%d second intervals\n"),
 							 newinterval );
-						ASSERT( strlen( intervalbuf )
+						assert( strlen( intervalbuf )
 							<
 							sizeof( intervalbuf ));
 						ackstr[ ackcnt++ ] = intervalbuf;
@@ -1966,7 +1967,7 @@ sigint_dialog( void )
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
@@ -2009,7 +2010,7 @@ sigintstr( void )
 	} else {
 		sprintf( buf, "%c", intchr );
 	}
-	ASSERT( strlen( buf ) < sizeof( buf ));
+	assert( strlen( buf ) < sizeof( buf ));
 
 	return buf;
 }
@@ -2030,11 +2031,11 @@ set_rlimits( size64_t *vmszp )
 	/* REFERENCED */
 	intgen_t rval;
 
-	ASSERT( minstacksz <= maxstacksz );
+	assert( minstacksz <= maxstacksz );
 
 	rval = getrlimit64( RLIMIT_AS, &rlimit64 );
 
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_AS org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
@@ -2044,7 +2045,7 @@ set_rlimits( size64_t *vmszp )
 		rlimit64.rlim_cur = rlimit64.rlim_max;
 		( void )setrlimit64( RLIMIT_AS, &rlimit64 );
 		rval = getrlimit64( RLIMIT_AS, &rlimit64 );
-		ASSERT( ! rval );
+		assert( ! rval );
 		mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 			"RLIMIT_VMEM now cur 0x%llx max 0x%llx\n",
 			rlimit64.rlim_cur,
@@ -2054,9 +2055,9 @@ set_rlimits( size64_t *vmszp )
 	vmsz = ( size64_t )rlimit64.rlim_cur;
 #endif /* RESTORE */
 	
-	ASSERT( minstacksz <= maxstacksz );
+	assert( minstacksz <= maxstacksz );
 	rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_STACK org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
@@ -2076,7 +2077,7 @@ set_rlimits( size64_t *vmszp )
 			rlimit64.rlim_max = minstacksz;
 			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
 			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-			ASSERT( ! rval );
+			assert( ! rval );
 			if ( rlimit64.rlim_cur < minstacksz ) {
 				mlog( MLOG_NORMAL
 				      |
@@ -2103,7 +2104,7 @@ set_rlimits( size64_t *vmszp )
 			rlimit64.rlim_cur = minstacksz;
 			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
 			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-			ASSERT( ! rval );
+			assert( ! rval );
 			if ( rlimit64.rlim_cur < minstacksz ) {
 				mlog( MLOG_NORMAL
 				      |
@@ -2131,7 +2132,7 @@ set_rlimits( size64_t *vmszp )
 		rlimit64.rlim_cur = maxstacksz;
 		( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
 		rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
-		ASSERT( ! rval );
+		assert( ! rval );
 		if ( rlimit64.rlim_cur > maxstacksz ) {
 			mlog( MLOG_NORMAL
 			      |
@@ -2152,14 +2153,14 @@ set_rlimits( size64_t *vmszp )
 	      rlimit64.rlim_max );
 
 	rval = getrlimit64( RLIMIT_DATA, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_DATA org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
 	      rlimit64.rlim_max );
 	
 	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_FSIZE org cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
@@ -2169,14 +2170,14 @@ set_rlimits( size64_t *vmszp )
 	rlimit64.rlim_cur = RLIM64_INFINITY;
 	( void )setrlimit64( RLIMIT_FSIZE, &rlimit64 );
 	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_FSIZE now cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
 	      rlimit64.rlim_max );
 	
 	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_CPU cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
@@ -2184,7 +2185,7 @@ set_rlimits( size64_t *vmszp )
 	rlimit64.rlim_cur = rlimit64.rlim_max;
 	( void )setrlimit64( RLIMIT_CPU, &rlimit64 );
 	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
-	ASSERT( ! rval );
+	assert( ! rval );
 	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
 	      "RLIMIT_CPU now cur 0x%llx max 0x%llx\n",
 	      rlimit64.rlim_cur,
diff --git a/common/media.c b/common/media.c
index 4ad7776..53b94d1 100644
--- a/common/media.c
+++ b/common/media.c
@@ -26,6 +26,7 @@
 #include <sys/dirent.h>
 #include <stdio.h>
 #include <getopt.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -91,8 +92,8 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
 
 	/* sanity check asserts
 	 */
-	ASSERT( sizeof( media_hdr_t ) == MEDIA_HDR_SZ );
-	ASSERT( MEDIA_MARKLOG_SZ == sizeof( media_marklog_t ));
+	assert( sizeof( media_hdr_t ) == MEDIA_HDR_SZ );
+	assert( MEDIA_MARKLOG_SZ == sizeof( media_marklog_t ));
 
 	/* scan the command line for a media label
 	 */
@@ -143,7 +144,7 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
 	 */
 	mediacnt = dsp->ds_drivecnt;
 	mediapp = ( media_t ** )calloc( mediacnt, sizeof( media_t * ));
-	ASSERT( mediapp );
+	assert( mediapp );
 	for ( mediaix = 0 ; mediaix < mediacnt ; mediaix++ ) {
 		mediapp[ mediaix ] = media_alloc( dsp->ds_drivep[ mediaix ],
 					 	  medialabel );
@@ -266,7 +267,7 @@ media_alloc( drive_t *drivep,
 	size_t mwhdrsz;
 
 	mediap = ( media_t * )calloc( 1, sizeof( media_t ));
-	ASSERT( mediap );
+	assert( mediap );
 
 	grhdrp = 0;
 	gwhdrp = 0;
@@ -279,12 +280,12 @@ media_alloc( drive_t *drivep,
 			      &gwhdrp,
 			      ( char ** )&mwhdrp,
 			      &mwhdrsz );
-	ASSERT( grhdrp );
-	ASSERT( gwhdrp );
-	ASSERT( mrhdrp );
-	ASSERT( mwhdrp );
-	ASSERT( mrhdrsz == MEDIA_HDR_SZ );
-	ASSERT( mwhdrsz == MEDIA_HDR_SZ );
+	assert( grhdrp );
+	assert( gwhdrp );
+	assert( mrhdrp );
+	assert( mwhdrp );
+	assert( mrhdrsz == MEDIA_HDR_SZ );
+	assert( mwhdrsz == MEDIA_HDR_SZ );
 
 	mediap->m_greadhdrp = grhdrp;
 	mediap->m_gwritehdrp = gwhdrp;
diff --git a/common/mlog.c b/common/mlog.c
index b0135b9..c546036 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -27,6 +27,7 @@
 #include <time.h>
 #include <getopt.h>
 #include <pthread.h>
+#include <assert.h>
 
 #include "types.h"
 #include "qlock.h"
@@ -157,9 +158,9 @@ mlog_init1( intgen_t argc, char *argv[ ] )
 	vsymcnt = sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
 	suboptstrs = ( char ** )calloc( MLOG_SS_CNT + vsymcnt + 1,
 					sizeof( char * ));
-	ASSERT( suboptstrs );
+	assert( suboptstrs );
 	for ( soix = 0 ; soix < MLOG_SS_CNT ; soix++ ) {
-		ASSERT( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
+		assert( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
 			/* unrelated, but opportunity to chk */
 		suboptstrs[ soix ] = mlog_ss_names[ soix ];
 	}
@@ -210,7 +211,7 @@ mlog_init1( intgen_t argc, char *argv[ ] )
 					usage( );
 					return BOOL_FALSE;
 				}
-				ASSERT( ( ix_t )suboptix
+				assert( ( ix_t )suboptix
 					<
 					MLOG_SS_CNT + vsymcnt );
 				if ( suboptix < MLOG_SS_CNT ) {
@@ -273,8 +274,8 @@ mlog_init1( intgen_t argc, char *argv[ ] )
 	 */
 	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
 		if ( mlog_level_ss[ ssix ] < 0 ) {
-			ASSERT( mlog_level_ss[ ssix ] == -1 );
-			ASSERT( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
+			assert( mlog_level_ss[ ssix ] == -1 );
+			assert( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
 			mlog_level_ss[ ssix ] = mlog_level_ss[ MLOG_SS_GEN ];
 		}
 	}
@@ -375,7 +376,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
 	level = levelarg & MLOG_LEVELMASK;
 	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
 
-	ASSERT( ss < MLOG_SS_CNT );
+	assert( ss < MLOG_SS_CNT );
 	if ( level > mlog_level_ss[ ss ] ) {
 		return;
 	}
@@ -402,7 +403,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
 				 tmp->tm_hour,
 				 tmp->tm_min,
 				 tmp->tm_sec );
-			ASSERT( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
+			assert( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
 		} else {
 			mlog_tsstr[ 0 ] = 0;
 		}
@@ -676,7 +677,7 @@ mlog_get_hint( void )
 
 	ok = stream_get_exit_status(pthread_self(), states, N(states),
 				    NULL, NULL, NULL, NULL, &hint);
-	ASSERT(ok);
+	assert(ok);
 	return hint;
 }
 
@@ -736,7 +737,7 @@ mlog_exit_flush(void)
 						    &exit_code,
 						    &exit_return,
 						    &exit_hint);
-			ASSERT(ok);
+			assert(ok);
 
 			/* hint takes priority over return */
 			rv = (exit_hint != RV_NONE) ? exit_hint : exit_return;
@@ -771,7 +772,7 @@ mlog_exit_flush(void)
 	else if (IS_INCOMPLETE(rv)) incomplete = BOOL_TRUE;
 
 	/* if we don't have an exit code here there is a problem */
-	ASSERT(VALID_EXIT_CODE(mlog_main_exit_code));
+	assert(VALID_EXIT_CODE(mlog_main_exit_code));
 	if (interrupt) status_str = "INTERRUPT";
 	else if (quit) status_str = "QUIT";
 	else if (incomplete) status_str = "INCOMPLETE";
diff --git a/common/openutil.c b/common/openutil.c
index 9a88d67..c3b8d9a 100644
--- a/common/openutil.c
+++ b/common/openutil.c
@@ -22,6 +22,7 @@
 #include <limits.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -56,7 +57,7 @@ open_pathalloc( char *dirname, char *basename, pid_t pid )
   	}
 	namelen = dirlen + 1 + strlen( basename ) + pidlen + 1;
 	namebuf = ( char * )calloc( 1, namelen );
-  	ASSERT( namebuf );
+  	assert( namebuf );
 
   	if ( pid ) {
 		( void )snprintf( namebuf, namelen, "%s/%s.%d", dirname, basename, pid );
diff --git a/common/path.c b/common/path.c
index ca24f6a..e40c473 100644
--- a/common/path.c
+++ b/common/path.c
@@ -17,6 +17,7 @@
  */
 
 #include <xfs/xfs.h>
+#include <assert.h>
 
 #include "path.h"
 
@@ -51,8 +52,8 @@ path_diff( char *path, char *base )
 {
 	char *diff;
 
-	ASSERT( *base == '/' );
-	ASSERT( *path == '/' );
+	assert( *base == '/' );
+	assert( *path == '/' );
 
 	if ( ! path_beginswith( path, base )) {
 		return 0;
@@ -70,7 +71,7 @@ path_diff( char *path, char *base )
 	}
 
 	diff = ( char * )calloc( 1, strlen( path ) + 1 );
-	ASSERT( diff );
+	assert( diff );
 	strcpy( diff, path );
 
 	return diff;
@@ -102,7 +103,7 @@ path_reltoabs( char *dir, char *basedir )
 					   strlen( dir )
 					   +
 					   1 );
-		ASSERT( absdir );
+		assert( absdir );
 
 		( void )sprintf( absdir, "%s/%s", basedir, dir );
 
@@ -127,7 +128,7 @@ path_normalize( char *path )
 	char *pep;
 	char *npath;
 
-	ASSERT( path[ 0 ] == '/' );
+	assert( path[ 0 ] == '/' );
 
 	while ( ( pep = pem_next( pemp )) != 0 ) {
 		if ( ! strcmp( pep, "" )) {
@@ -163,7 +164,7 @@ static pem_t *
 pem_alloc( char *path )
 {
 	pem_t *pemp = ( pem_t * )calloc( 1, sizeof( pem_t ));
-	ASSERT( pemp );
+	assert( pemp );
 	pemp->pem_head = path;
 	pemp->pem_next = pemp->pem_head;
 
@@ -207,7 +208,7 @@ pem_next( pem_t *pemp )
 	/* allocate buffer to hold the path element, incl null termination
 	 */
 	p = ( char * )malloc( len + 1 );
-	ASSERT( p );
+	assert( p );
 
 	/* copy the path element into the buffer
 	 */
@@ -230,7 +231,7 @@ static pa_t *
 pa_alloc( void )
 {
 	pa_t *pap = ( pa_t * )calloc( 1, sizeof( pa_t ));
-	ASSERT( pap );
+	assert( pap );
 
 	return pap;
 }
@@ -250,7 +251,7 @@ pa_free( pa_t *pap )
 static void
 pa_append( pa_t *pap, char *pep )
 {
-	ASSERT( pap->pa_cnt < PAMAX );
+	assert( pap->pa_cnt < PAMAX );
 
 	pap->pa_array[ pap->pa_cnt ] = pep;
 
@@ -261,12 +262,12 @@ static int
 pa_peel( pa_t *pap )
 {
 	if ( pap->pa_cnt <= 0 ) {
-		ASSERT( pap->pa_cnt == 0 );
+		assert( pap->pa_cnt == 0 );
 		return 0;
 	}
 
 	pap->pa_cnt--;
-	ASSERT( pap->pa_array[ pap->pa_cnt ] );
+	assert( pap->pa_array[ pap->pa_cnt ] );
 	free( ( void * )pap->pa_array[ pap->pa_cnt ] );
 	pap->pa_array[ pap->pa_cnt ] = 0;
 
@@ -292,7 +293,7 @@ pa_gen( pa_t *pap )
 	retp = ( char * )malloc( sz );
 
 	if (  pap->pa_cnt <= 0 ) {
-		ASSERT(  pap->pa_cnt == 0 );
+		assert(  pap->pa_cnt == 0 );
 		sprintf( retp, "/" );
 	} else {
 		p = retp;
diff --git a/common/qlock.c b/common/qlock.c
index ae8466d..d88917c 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -21,6 +21,7 @@
 
 #include <pthread.h>
 #include <semaphore.h>
+#include <assert.h>
 
 #include "types.h"
 #include "qlock.h"
@@ -78,13 +79,13 @@ qlock_alloc( ix_t ord )
 
 	/* verify the ordinal is not already taken, and mark as taken
 	 */
-	ASSERT( ! QLOCK_ORDMAP_GET( qlock_ordalloced, ord ));
+	assert( ! QLOCK_ORDMAP_GET( qlock_ordalloced, ord ));
 	QLOCK_ORDMAP_SET( qlock_ordalloced, ord );
 
 	/* allocate lock memory
 	 */
 	qlockp = ( qlock_t * )calloc( 1, sizeof( qlock_t ));
-	ASSERT( qlockp );
+	assert( qlockp );
 
 	/* initialize the mutex
 	 */
@@ -118,7 +119,7 @@ qlock_lock( qlockh_t qlockh )
 		      qlockp->ql_ord,
 		      thread_ordmap );
 	}
-	ASSERT( ! QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
+	assert( ! QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
 
 	/* assert that no locks with a lesser ordinal are held by this thread
 	 */
@@ -129,12 +130,12 @@ qlock_lock( qlockh_t qlockh )
 		      qlockp->ql_ord,
 		      thread_ordmap );
 	}
-	ASSERT( ! QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord ));
+	assert( ! QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord ));
 
 	/* acquire the lock
 	 */
 	rval = pthread_mutex_lock( &qlockp->ql_mutex );
-	ASSERT( !rval );
+	assert( !rval );
 
 	/* add ordinal to this threads ordmap
 	 */
@@ -150,7 +151,7 @@ qlock_unlock( qlockh_t qlockh )
 	
 	/* verify lock is held by this thread
 	 */
-	ASSERT( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
+	assert( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
 
 	/* clear lock's ord from thread's ord map
 	 */
@@ -159,7 +160,7 @@ qlock_unlock( qlockh_t qlockh )
 	/* release the lock
 	 */
 	rval = pthread_mutex_unlock( &qlockp->ql_mutex );
-	ASSERT( ! rval );
+	assert( ! rval );
 }
 
 qsemh_t
@@ -171,12 +172,12 @@ qsem_alloc( ix_t cnt )
 	/* allocate a semaphore
 	 */
 	semp = ( sem_t * )calloc( 1, sizeof( sem_t ));
-	ASSERT( semp );
+	assert( semp );
 
 	/* initialize the semaphore
 	 */
 	rval = sem_init( semp, 0, cnt );
-	ASSERT( !rval );
+	assert( !rval );
 
 	return ( qsemh_t )semp;
 }
@@ -190,7 +191,7 @@ qsem_free( qsemh_t qsemh )
 	/* destroy the mutex and condition
 	 */
 	rval = sem_destroy( semp );
-	ASSERT( !rval );
+	assert( !rval );
 
 	/* free the semaphore
 	 */
@@ -206,7 +207,7 @@ qsemP( qsemh_t qsemh )
 	/* "P" the semaphore
 	 */
 	rval = sem_wait( semp );
-	ASSERT( !rval );
+	assert( !rval );
 }
 
 void
@@ -218,7 +219,7 @@ qsemV( qsemh_t qsemh )
 	/* "V" the semaphore
 	 */
 	rval = sem_post( semp );
-	ASSERT( !rval );
+	assert( !rval );
 }
 
 bool_t
@@ -229,7 +230,7 @@ qsemPwouldblock( qsemh_t qsemh )
 	intgen_t rval;
 
 	rval = sem_getvalue( semp, &count );
-	ASSERT( !rval );
+	assert( !rval );
 
 	return count <= 0 ? BOOL_TRUE : BOOL_FALSE;
 }
@@ -242,7 +243,7 @@ qsemPavail( qsemh_t qsemh )
 	intgen_t rval;
 
 	rval = sem_getvalue( semp, &count );
-	ASSERT( !rval );
+	assert( !rval );
 
 	return count < 0 ? 0 : count;
 }
diff --git a/common/ring.c b/common/ring.c
index 0d2feb0..f3de7c4 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <malloc.h>
+#include <assert.h>
 
 #include "types.h"
 #include "qlock.h"
@@ -56,7 +57,7 @@ ring_create( size_t ringlen,
 	/* allocate a ring descriptor
 	 */
 	ringp = ( ring_t * )calloc( 1, sizeof( ring_t ));
-	ASSERT( ringp );
+	assert( ringp );
 	ringp->r_len = ringlen;
 	ringp->r_clientctxp = clientctxp;
 	ringp->r_readfunc = readfunc;
@@ -86,7 +87,7 @@ ring_create( size_t ringlen,
 	/* allocate the ring messages
 	 */
 	ringp->r_msgp = ( ring_msg_t * )calloc( ringlen, sizeof( ring_msg_t ));
-	ASSERT( ringp->r_msgp );
+	assert( ringp->r_msgp );
 
 	/* allocate the buffers and initialize the messages
 	 */
@@ -115,7 +116,7 @@ ring_create( size_t ringlen,
 					*rvalp = EPERM;
 					return 0;
 				}
-				ASSERT( 0 );
+				assert( 0 );
 			}
 		}
 	}
@@ -126,7 +127,7 @@ ring_create( size_t ringlen,
 			    drive_index,
 			    _("slave"),
 			    ringp );
-	ASSERT( ok );
+	assert( ok );
 
 	return ringp;
 }
@@ -138,7 +139,7 @@ ring_get( ring_t *ringp )
 
 	/* assert client currently holds no messages
 	 */
-	ASSERT( ringp->r_client_cnt == 0 );
+	assert( ringp->r_client_cnt == 0 );
 
 	/* bump client message count and note if client needs to block
 	 */
@@ -157,11 +158,11 @@ ring_get( ring_t *ringp )
 
 	/* assert the message is where it belongs
 	 */
-	ASSERT( msgp->rm_loc == RING_LOC_READY );
+	assert( msgp->rm_loc == RING_LOC_READY );
 
 	/* verify the message index has not become corrupted
 	 */
-	ASSERT( msgp->rm_mix == ringp->r_ready_out_ix );
+	assert( msgp->rm_mix == ringp->r_ready_out_ix );
 
 	/* bump the output index
 	 */
@@ -187,15 +188,15 @@ ring_put( ring_t *ringp, ring_msg_t *msgp )
 {
 	/* assert the client holds exactly one message
 	 */
-	ASSERT( ringp->r_client_cnt == 1 );
+	assert( ringp->r_client_cnt == 1 );
 
 	/* assert the client is returning the right message
 	 */
-	ASSERT( msgp->rm_mix == ringp->r_active_in_ix );
+	assert( msgp->rm_mix == ringp->r_active_in_ix );
 
 	/* assert the message is where it belongs
 	 */
-	ASSERT( msgp->rm_loc == RING_LOC_CLIENT );
+	assert( msgp->rm_loc == RING_LOC_CLIENT );
 
 	/* decrement the count of messages held by the client
 	 */
@@ -224,13 +225,13 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
 	/* if the client is not holding a message, get the next message
 	 */
 	if ( ringp->r_client_cnt == 0 ) {
-		ASSERT( ! msgp );
+		assert( ! msgp );
 		msgp = ring_get( ringp );
-		ASSERT( msgp );
-		ASSERT( ringp->r_client_cnt == 1 );
+		assert( msgp );
+		assert( ringp->r_client_cnt == 1 );
 	} else {
-		ASSERT( msgp );
-		ASSERT( ringp->r_client_cnt == 1 );
+		assert( msgp );
+		assert( ringp->r_client_cnt == 1 );
 	}
 
 	/* tell the slave to abort
@@ -240,24 +241,24 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
 
 	/* wait for the reset to be acknowledged
 	 */
-	ASSERT( ringp->r_client_cnt == 0 );
+	assert( ringp->r_client_cnt == 0 );
 	do {
 		/* pull a message from the ready queue
 		 */
 		qsemP( ringp->r_ready_qsemh );
 		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
-		ASSERT( msgp->rm_loc == RING_LOC_READY );
+		assert( msgp->rm_loc == RING_LOC_READY );
 		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
 					%
 					ringp->r_len;
 		ringp->r_client_cnt++;
 	} while ( msgp->rm_stat != RING_STAT_RESETACK );
-	ASSERT( ringp->r_client_cnt == ringp->r_len );
+	assert( ringp->r_client_cnt == ringp->r_len );
 
 	/* re-initialize the ring
 	 */
-	ASSERT( qsemPavail( ringp->r_ready_qsemh ) == 0 );
-	ASSERT( qsemPavail( ringp->r_active_qsemh ) == 0 );
+	assert( qsemPavail( ringp->r_ready_qsemh ) == 0 );
+	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
 	ringp->r_ready_in_ix = 0;
 	ringp->r_ready_out_ix = 0;
 	ringp->r_active_in_ix = 0;
@@ -273,8 +274,8 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
 		msgp->rm_loc = RING_LOC_READY;
 		qsemV( ringp->r_ready_qsemh );
 	}
-	ASSERT( qsemPavail( ringp->r_ready_qsemh ) == ringp->r_len );
-	ASSERT( qsemPavail( ringp->r_active_qsemh ) == 0 );
+	assert( qsemPavail( ringp->r_ready_qsemh ) == ringp->r_len );
+	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
 }
 
 void
@@ -284,7 +285,7 @@ ring_destroy( ring_t *ringp )
 
 	/* the client must not be holding a message
 	 */
-	ASSERT( ringp->r_client_cnt == 0 );
+	assert( ringp->r_client_cnt == 0 );
 
 	/* get a message
 	 */
@@ -302,7 +303,7 @@ ring_destroy( ring_t *ringp )
 		 */
 		qsemP( ringp->r_ready_qsemh );
 		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
-		ASSERT( msgp->rm_loc == RING_LOC_READY );
+		assert( msgp->rm_loc == RING_LOC_READY );
 		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
 					%
 					ringp->r_len;
@@ -323,7 +324,7 @@ ring_slave_get( ring_t *ringp )
 
 	/* assert slave currently holds no messages
 	 */
-	ASSERT( ringp->r_slave_cnt == 0 );
+	assert( ringp->r_slave_cnt == 0 );
 
 	/* bump slave message count and note if slave needs to block
 	 */
@@ -342,11 +343,11 @@ ring_slave_get( ring_t *ringp )
 
 	/* assert the message is where it belongs
 	 */
-	ASSERT( msgp->rm_loc == RING_LOC_ACTIVE );
+	assert( msgp->rm_loc == RING_LOC_ACTIVE );
 
 	/* verify the message index has not become corrupted
 	 */
-	ASSERT( msgp->rm_mix == ringp->r_active_out_ix );
+	assert( msgp->rm_mix == ringp->r_active_out_ix );
 
 	/* bump the output index
 	 */
@@ -372,15 +373,15 @@ ring_slave_put( ring_t *ringp, ring_msg_t *msgp )
 {
 	/* assert the slave holds exactly one message
 	 */
-	ASSERT( ringp->r_slave_cnt == 1 );
+	assert( ringp->r_slave_cnt == 1 );
 
 	/* assert the slave is returning the right message
 	 */
-	ASSERT( msgp->rm_mix == ringp->r_ready_in_ix );
+	assert( msgp->rm_mix == ringp->r_ready_in_ix );
 
 	/* assert the message is where it belongs
 	 */
-	ASSERT( msgp->rm_loc == RING_LOC_SLAVE );
+	assert( msgp->rm_loc == RING_LOC_SLAVE );
 
 	/* decrement the count of messages held by the slave
 	 */
@@ -435,7 +436,7 @@ ring_slave_entry( void *ringctxp )
 			}
 			if ( ! ringp->r_first_io_time ) {
 				ringp->r_first_io_time = time( 0 );
-				ASSERT( ringp->r_first_io_time );
+				assert( ringp->r_first_io_time );
 			}
 			rval = ( ringp->r_readfunc )( ringp->r_clientctxp,
 						      msgp->rm_bufp );
@@ -455,7 +456,7 @@ ring_slave_entry( void *ringctxp )
 			}
 			if ( ! ringp->r_first_io_time ) {
 				ringp->r_first_io_time = time( 0 );
-				ASSERT( ringp->r_first_io_time );
+				assert( ringp->r_first_io_time );
 			}
 			rval = ( ringp->r_writefunc )( ringp->r_clientctxp,
 						       msgp->rm_bufp );
diff --git a/common/stream.c b/common/stream.c
index 6704661..0db1be3 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -20,6 +20,7 @@
 #include <xfs/jdm.h>
 
 #include <pthread.h>
+#include <assert.h>
 
 #include "types.h"
 #include "exit.h"
@@ -65,7 +66,7 @@ stream_register( pthread_t tid, intgen_t streamix )
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
-	ASSERT( streamix < STREAM_SIMMAX );
+	assert( streamix < STREAM_SIMMAX );
 
 	lock();
 	for ( ; p < ep ; p++ ) {
@@ -75,7 +76,7 @@ stream_register( pthread_t tid, intgen_t streamix )
 		}
 	}
 	unlock();
-	ASSERT( p < ep );
+	assert( p < ep );
 
 	if ( p >= ep ) return;
 
@@ -98,7 +99,7 @@ stream_dead( pthread_t tid )
 			p->s_state = S_ZOMBIE;
 			break;
 		}
-	ASSERT( p < ep );
+	assert( p < ep );
 }
 
 void
@@ -116,7 +117,7 @@ stream_free( pthread_t tid )
 		}
 	}
 	unlock();
-	ASSERT( p < ep );
+	assert( p < ep );
 }
 
 int
@@ -126,7 +127,7 @@ stream_find_all( stream_state_t states[], int nstates,
 	int i, count = 0;
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
-	ASSERT(nstates > 0 && ntids > 0);
+	assert(nstates > 0 && ntids > 0);
 
 	if (!initialized)
 		return 0;
@@ -150,7 +151,7 @@ stream_find( pthread_t tid, stream_state_t s[], int nstates )
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
 
-	ASSERT(nstates > 0);
+	assert(nstates > 0);
 
 	/* note we don't lock the stream array in this function */
 	for ( ; p < ep ; p++ )
@@ -275,7 +276,7 @@ stream_cnt( void )
 	size_t ixcnt;
 	size_t bitix;
 
-	ASSERT( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
+	assert( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
 	
 	lock();
 	for ( ; p < ep ; p++ ) {
diff --git a/common/util.c b/common/util.c
index 73f18fe..1dc6d6c 100644
--- a/common/util.c
+++ b/common/util.c
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -46,9 +47,9 @@ write_buf( char *bufp,
 	while ( bufsz ) {
 		int rval;
 
-		ASSERT( bufsz > 0 );
+		assert( bufsz > 0 );
 		mbufp = ( *get_write_buf_funcp )( contextp, bufsz, &mbufsz );
-		ASSERT( mbufsz <= bufsz );
+		assert( mbufsz <= bufsz );
 		if ( bufp ) {
 			(void)memcpy( ( void * )mbufp, ( void * )bufp, mbufsz );
 		} else {
@@ -86,7 +87,7 @@ read_buf( char *bufp,
 		if ( *statp ) {
 			break;
 		}
-		ASSERT( mbufsz <= bufsz );
+		assert( mbufsz <= bufsz );
 		if ( bufp ) {
 			( void )memcpy( (void *)bufp, (void *)mbufp, mbufsz );
 			bufp += mbufsz;
@@ -255,7 +256,7 @@ bigstat_one( intgen_t fsfd,
         xfs_fsop_bulkreq_t bulkreq;
 	intgen_t count = 0;
 
-	ASSERT( ino > 0 );
+	assert( ino > 0 );
         bulkreq.lastip = (__u64 *)&ino;
         bulkreq.icount = 1;
         bulkreq.ubuffer = statp;
@@ -354,13 +355,13 @@ diriter( jdm_fshandle_t *fshandlep,
 	intgen_t cbrval;
 
 	if ( usrgdp ) {
-		ASSERT( usrgdsz >= sizeof( struct dirent ) );
+		assert( usrgdsz >= sizeof( struct dirent ) );
 		gdsz = usrgdsz;
 		gdp = ( struct dirent * )usrgdp;
 	} else {
 		gdsz = pgsz;
 		gdp = ( struct dirent * )malloc( gdsz );
-		ASSERT( gdp );
+		assert( gdp );
 	}
 
 	/* open the directory
@@ -377,7 +378,7 @@ diriter( jdm_fshandle_t *fshandlep,
 		}
 		return -1;
 	}
-	ASSERT( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
+	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
 
 	/* lots of buffering done here, to achieve OS-independence.
 	 * if proves to be to much overhead, can streamline.
@@ -389,8 +390,8 @@ diriter( jdm_fshandle_t *fshandlep,
 		intgen_t nread;
 		register size_t reclen;
 
-		ASSERT( scrval == 0 );
-		ASSERT( cbrval == 0 );
+		assert( scrval == 0 );
+		assert( cbrval == 0 );
 
 		nread = getdents_wrap( fd, (char *)gdp, gdsz );
 		
@@ -421,12 +422,12 @@ diriter( jdm_fshandle_t *fshandlep,
 		      nread > 0
 		      ;
 		      nread -= ( intgen_t )reclen,
-		      ASSERT( nread >= 0 ),
+		      assert( nread >= 0 ),
 		      p = ( struct dirent * )( ( char * )p + reclen ),
 		      reclen = ( size_t )p->d_reclen ) {
 			xfs_bstat_t statbuf;
-			ASSERT( scrval == 0 );
-			ASSERT( cbrval == 0 );
+			assert( scrval == 0 );
+			assert( cbrval == 0 );
 
 			/* skip "." and ".."
 			 */
@@ -538,7 +539,7 @@ fold_init( fold_t fold, char *infostr, char c )
 	char *endp;
 	ix_t cnt;
 
-	ASSERT( sizeof( fold_t ) == FOLD_LEN + 1 );
+	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
 
 	infolen = strlen( infostr );
 	if ( infolen > FOLD_LEN - 4 ) {
@@ -551,23 +552,23 @@ fold_init( fold_t fold, char *infostr, char c )
 	p = &fold[ 0 ];
 	endp = &fold[ sizeof( fold_t ) - 1 ];
 
-	ASSERT( p < endp );
+	assert( p < endp );
 	*p++ = ' ';
 	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
 		*p = c;
 	}
-	ASSERT( p < endp );
+	assert( p < endp );
 	*p++ = ' ';
-	ASSERT( p < endp );
-	ASSERT( p + infolen < endp );
+	assert( p < endp );
+	assert( p + infolen < endp );
 	strcpy( p, infostr );
 	p += infolen;
-	ASSERT( p < endp );
+	assert( p < endp );
 	*p++ = ' ';
-	ASSERT( p < endp );
+	assert( p < endp );
 	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
 		*p = c;
 	}
-	ASSERT( p <= endp );
+	assert( p <= endp );
 	*p = 0;
 }
diff --git a/dump/content.c b/dump/content.c
index 5f7b4d9..3682358 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -30,6 +30,7 @@
 #include <sys/ioctl.h>
 #include <sys/quota.h>
 #include <malloc.h>
+#include <assert.h>
 
 #ifdef linux
 #include <xfs/xqm.h>
@@ -559,18 +560,18 @@ content_init( intgen_t argc,
 
 	/* basic sanity checks
 	 */
-	ASSERT( sizeof( mode_t ) == MODE_SZ );
-	ASSERT( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
-	ASSERT( sizeof( bstat_t ) == BSTAT_SZ );
-	ASSERT( sizeof( filehdr_t ) == FILEHDR_SZ );
-	ASSERT( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
-	ASSERT( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
-	ASSERT( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
-	ASSERT( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
-	ASSERT( sizeofmember( content_hdr_t, ch_specific )
+	assert( sizeof( mode_t ) == MODE_SZ );
+	assert( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
+	assert( sizeof( bstat_t ) == BSTAT_SZ );
+	assert( sizeof( filehdr_t ) == FILEHDR_SZ );
+	assert( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
+	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
+	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
+	assert( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
+	assert( sizeofmember( content_hdr_t, ch_specific )
 		>=
 		sizeof( content_inode_hdr_t ));
-	ASSERT( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
+	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
 
 	/* calculate offsets of portions of the write hdr template
 	 */
@@ -737,20 +738,20 @@ content_init( intgen_t argc,
 	 */
 	if ( subtreecnt ) {
 		subtreep = ( char ** )calloc( subtreecnt, sizeof( char * ));
-		ASSERT( subtreep );
+		assert( subtreep );
 		optind = 1;
 		opterr = 0;
 		subtreeix = 0;
 		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
 			switch ( c ) {
 			case GETOPT_SUBTREE:
-				ASSERT( subtreeix < subtreecnt );
-				ASSERT( optarg && optarg[ 0 ] != '-' );
+				assert( subtreeix < subtreecnt );
+				assert( optarg && optarg[ 0 ] != '-' );
 				subtreep[ subtreeix++ ] = optarg;
 				break;
 			}
 		}
-		ASSERT( subtreeix == subtreecnt );
+		assert( subtreeix == subtreecnt );
 	} else {
 		subtreep = 0;
 	}
@@ -900,7 +901,7 @@ content_init( intgen_t argc,
 			sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
 			sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
 								sizeof( drange_t ));
-			ASSERT( sc_resumerangep );
+			assert( sc_resumerangep );
 			for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
 				inv_stream_t *bsp;
 				inv_stream_t *esp;
@@ -966,7 +967,7 @@ content_init( intgen_t argc,
 		inv_free_session( &sessp );
 		sessp = 0;
 		ok = inv_close( inv_idbt );
-		ASSERT( ok );
+		assert( ok );
 		inv_idbt = INV_TOKEN_NULL;
 		goto baseuuidbypass;
 	}
@@ -1028,7 +1029,7 @@ content_init( intgen_t argc,
 						   (u_char_t)sc_level,
 						   &sessp);
 		ok1 = inv_close( inv_idbt );
-		ASSERT( ok1 );
+		assert( ok1 );
 		if ( ! ok ) {
 			sessp = 0;
 		}
@@ -1046,7 +1047,7 @@ content_init( intgen_t argc,
 		sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
 		sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
 						        sizeof( drange_t ));
-		ASSERT( sc_resumerangep );
+		assert( sc_resumerangep );
 		for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
 			inv_stream_t *bsp;
 			inv_stream_t *esp;
@@ -1119,8 +1120,8 @@ baseuuidbypass:
 		samefoundpr = BOOL_FALSE;
 	}
 	if ( underfoundpr ) {
-		ASSERT( underlevel <= LEVEL_MAX );
-		ASSERT( undertime );
+		assert( underlevel <= LEVEL_MAX );
+		assert( undertime );
 		if ( samefoundpr ) {
 			if ( undertime >= sametime ) {
 				if ( underinterruptedpr ) {
@@ -1157,7 +1158,7 @@ baseuuidbypass:
 				sc_incrbaselevel = underlevel;
 				uuid_copy(sc_incrbaseid, underid);
 				sc_resumepr = BOOL_FALSE;
-				ASSERT( sc_resumerangep );
+				assert( sc_resumerangep );
 				free( ( void * )sc_resumerangep );
 				sc_resumerangep = 0;
 			} else {
@@ -1179,14 +1180,14 @@ baseuuidbypass:
 					      sc_level,
 					      sc_level );
 				}
-				ASSERT( sametime );
+				assert( sametime );
 				sc_incrpr = BOOL_TRUE;
 				sc_incrbasetime = undertime;
 				sc_incrbaselevel = underlevel;
 				sc_resumepr = BOOL_TRUE;
 				sc_resumebasetime = sametime;
 				uuid_copy(sc_resumebaseid, sameid);
-				ASSERT( sc_resumerangep );
+				assert( sc_resumerangep );
 			}
 		} else {
 			if ( underinterruptedpr ) {
@@ -1223,11 +1224,11 @@ baseuuidbypass:
 			sc_incrbaselevel = underlevel;
 			uuid_copy(sc_incrbaseid, underid);
 			sc_resumepr = BOOL_FALSE;
-			ASSERT( ! sc_resumerangep );
+			assert( ! sc_resumerangep );
 		}
 	} else {
 		if ( samefoundpr ) {
-			ASSERT( sametime );
+			assert( sametime );
 			if ( subtreecnt && ! samepartialpr ) {
 				mlog( MLOG_NORMAL | MLOG_WARNING, _(
 				      "level %u "
@@ -1250,11 +1251,11 @@ baseuuidbypass:
 			sc_resumepr = BOOL_TRUE;
 			sc_resumebasetime = sametime;
 			uuid_copy(sc_resumebaseid, sameid);
-			ASSERT( sc_resumerangep );
+			assert( sc_resumerangep );
 		} else {
 			sc_incrpr = BOOL_FALSE;
 			sc_resumepr = BOOL_FALSE;
-			ASSERT( ! sc_resumerangep );
+			assert( ! sc_resumerangep );
 			if ( sc_level > 0 ) {
 				mlog( MLOG_NORMAL | MLOG_ERROR, _(
 				      "cannot find earlier dump "
@@ -1294,9 +1295,9 @@ baseuuidbypass:
 			char incrtimestr[ 30 ];
 
 			strcpy( restimestr, ctimennl( &sc_resumebasetime ));
-			ASSERT( strlen( restimestr ) < sizeof( restimestr ));
+			assert( strlen( restimestr ) < sizeof( restimestr ));
 			strcpy( incrtimestr, ctimennl( &sc_incrbasetime ));
-			ASSERT( strlen( incrtimestr ) < sizeof( incrtimestr ));
+			assert( strlen( incrtimestr ) < sizeof( incrtimestr ));
 
 			mlog( MLOG_VERBOSE, _(
 			      "resuming level %d incremental dump of %s:%s "
@@ -1388,7 +1389,7 @@ baseuuidbypass:
 		}
 		sc_rootxfsstatp =
 			( xfs_bstat_t * )calloc( 1, sizeof( xfs_bstat_t ));
-		ASSERT( sc_rootxfsstatp );
+		assert( sc_rootxfsstatp );
 
 		if ( bigstat_one( sc_fsfd, rootstat.st_ino, sc_rootxfsstatp) < 0 ) {
 			mlog( MLOG_ERROR,
@@ -1433,7 +1434,7 @@ baseuuidbypass:
 	sc_stat_inomapcnt = ( size64_t )fs_getinocnt( mntpnt );
 
 	sc_startptp = ( startpt_t * )calloc( drivecnt, sizeof( startpt_t ));
-	ASSERT( sc_startptp );
+	assert( sc_startptp );
 	ok = inomap_build( sc_fshandlep,
 			   sc_fsfd,
 			   sc_rootxfsstatp,
@@ -1467,7 +1468,7 @@ baseuuidbypass:
 	 * an inomap for each media file. the dirdump flag will be set
 	 * in content_stream_dump() for streams which dump the directories.
 	 */
-	ASSERT( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
+	assert( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
 	scwhdrtemplatep->cih_mediafiletype = CIH_MEDIAFILETYPE_DATA;
 	scwhdrtemplatep->cih_level = ( int32_t )sc_level;
 	scwhdrtemplatep->cih_dumpattr = CIH_DUMPATTR_INOMAP;
@@ -1553,17 +1554,17 @@ baseuuidbypass:
 	/* allocate and populate per-stream context descriptors
 	 */
 	sc_contextp = ( context_t * )calloc( drivecnt, sizeof( context_t ));
-	ASSERT( sc_contextp );
+	assert( sc_contextp );
 	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
 		context_t *contextp = &sc_contextp[ strmix ];
 
 		contextp->cc_filehdrp =
 				( filehdr_t * )calloc( 1, sizeof( filehdr_t ));
-		ASSERT( contextp->cc_filehdrp );
+		assert( contextp->cc_filehdrp );
 
 		contextp->cc_extenthdrp =
 			    ( extenthdr_t * )calloc( 1, sizeof( extenthdr_t ));
-		ASSERT( contextp->cc_extenthdrp );
+		assert( contextp->cc_extenthdrp );
 
 		contextp->cc_getdentsbufsz = sizeof( struct dirent )
 					       +
@@ -1573,7 +1574,7 @@ baseuuidbypass:
 		}
 		contextp->cc_getdentsbufp =
 			   ( char * ) calloc( 1, contextp->cc_getdentsbufsz );
-		ASSERT( contextp->cc_getdentsbufp );
+		assert( contextp->cc_getdentsbufp );
 
 		contextp->cc_mdirentbufsz = sizeof( direnthdr_t  )
 					    +
@@ -1582,7 +1583,7 @@ baseuuidbypass:
 					    DIRENTHDR_ALIGN;
 		contextp->cc_mdirentbufp =
 			   ( char * ) calloc( 1, contextp->cc_mdirentbufsz );
-		ASSERT( contextp->cc_mdirentbufp );
+		assert( contextp->cc_mdirentbufp );
 
 		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
 		contextp->cc_extattrrtrvarraylen = EXTATTR_RTRVARRAY_LEN;
@@ -1592,15 +1593,15 @@ baseuuidbypass:
 		}
 		contextp->cc_extattrlistbufp =
 			   ( char * )calloc( 1, contextp->cc_extattrlistbufsz );
-		ASSERT( contextp->cc_extattrlistbufp );
+		assert( contextp->cc_extattrlistbufp );
 		contextp->cc_extattrrtrvarrayp =
 		  ( attr_multiop_t * )calloc( contextp->cc_extattrrtrvarraylen,
 				    sizeof( attr_multiop_t ));
-		ASSERT( contextp->cc_extattrrtrvarrayp );
+		assert( contextp->cc_extattrrtrvarrayp );
 		contextp->cc_extattrdumpbufp =
 			   ( char * )memalign( sizeof( extattrhdr_t ),
 					       contextp->cc_extattrdumpbufsz );
-		ASSERT( contextp->cc_extattrdumpbufp );
+		assert( contextp->cc_extattrdumpbufp );
 		if (hsm_fs_ctxtp) {
 			contextp->cc_hsm_f_ctxtp = HsmAllocateFileContext(
 				hsm_fs_ctxtp);
@@ -1611,7 +1612,7 @@ baseuuidbypass:
 		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
 		contextp->cc_readlinkbufp =
 			   ( char * ) calloc( 1, contextp->cc_readlinkbufsz );
-		ASSERT( contextp->cc_readlinkbufp );
+		assert( contextp->cc_readlinkbufp );
 
 		contextp->cc_inomap_contextp = inomap_alloc_context( );
 	}
@@ -1770,7 +1771,7 @@ content_statline( char **linespp[ ] )
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
 				 elapsed );
-			ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
+			assert( strlen( statline[ 0 ] ) < STATLINESZ );
 		} else {
 			sprintf( statline[ 0 ],
 				 "status at %02d:%02d:%02d: "
@@ -1784,7 +1785,7 @@ content_statline( char **linespp[ ] )
 				 (unsigned long long)sc_stat_inomapdone,
 				 (unsigned long long)sc_stat_inomapcnt,
 				 elapsed );
-			ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
+			assert( strlen( statline[ 0 ] ) < STATLINESZ );
 		}
 		return 1;
 	}
@@ -1835,7 +1836,7 @@ content_statline( char **linespp[ ] )
 				elapsed );
 	}
 
-	ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
+	assert( strlen( statline[ 0 ] ) < STATLINESZ );
 
 	/* optionally create stat lines for each drive
 	 */
@@ -1883,7 +1884,7 @@ content_statline( char **linespp[ ] )
 		sprintf( &statline[ statlinecnt ]
 				  [ strlen( statline[ statlinecnt ] ) ],
 			 "\n" );
-		ASSERT( strlen( statline[ statlinecnt ] ) < STATLINESZ );
+		assert( strlen( statline[ statlinecnt ] ) < STATLINESZ );
 		statlinecnt++;
 	}
 
@@ -1905,7 +1906,7 @@ create_inv_session(
 
 	/* create a cleanup handler to close the inventory on exit. */
 	rval = atexit( inv_cleanup );
-	ASSERT( ! rval );
+	assert( ! rval );
 
 	sc_inv_idbtoken = inv_open( ( inv_predicate_t )INV_BY_UUID,
 					INV_SEARCH_N_MOD,
@@ -1915,12 +1916,12 @@ create_inv_session(
 	}
 	qmntpnt = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
 					+ 1 + strlen( mntpnt ) + 1 );
-	ASSERT( qmntpnt );
-	ASSERT( strlen( gwhdrtemplatep->gh_hostname ));
+	assert( qmntpnt );
+	assert( strlen( gwhdrtemplatep->gh_hostname ));
 	sprintf( qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt );
 	qfsdevice = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
 					 + 1 + strlen( fsdevice ) + 1 );
-	ASSERT( qfsdevice );
+	assert( qfsdevice );
 	sprintf( qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice );
 
 	sc_inv_sestoken = inv_writesession_open( sc_inv_idbtoken,
@@ -1943,7 +1944,7 @@ create_inv_session(
 	*/
 	sc_inv_stmtokenp = ( inv_stmtoken_t * )
 				calloc( drivecnt, sizeof( inv_stmtoken_t ));
-	ASSERT( sc_inv_stmtokenp );
+	assert( sc_inv_stmtokenp );
 	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
 		drive_t *drivep = drivepp[ strmix ];
 		char *drvpath;
@@ -1971,7 +1972,7 @@ mark_set( drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags )
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	mark_t *markp = ( mark_t * )calloc( 1, sizeof( mark_t ));
-	ASSERT( markp );
+	assert( markp );
 
 	if ( flags & STARTPT_FLAGS_NULL ) {
 		mlog( MLOG_DEBUG,
@@ -2102,17 +2103,17 @@ content_stream_dump( ix_t strmix )
 
 	/* sanity checks
 	 */
-	ASSERT( RV_OK == 0 ); /* bigstat_iter depends on this */
+	assert( RV_OK == 0 ); /* bigstat_iter depends on this */
 
 	/* allocate a buffer for use by bstat_iter
 	 */
 	bstatbufp = ( xfs_bstat_t * )calloc( bstatbuflen,
 					     sizeof( xfs_bstat_t ));
-	ASSERT( bstatbufp );
+	assert( bstatbufp );
 
 	/* allocate an inomap context */
 	inomap_contextp = inomap_alloc_context();
-	ASSERT( inomap_contextp );
+	assert( inomap_contextp );
 
 	/* determine if stream terminators will be used and are expected.
 	 * this will be revised each time a new media file is begun.
@@ -2253,7 +2254,7 @@ content_stream_dump( ix_t strmix )
 		if ( rv == RV_CORE ) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		ASSERT( rv == RV_OK );
+		assert( rv == RV_OK );
 		if ( rv != RV_OK ) {
 			return mlog_exit(EXIT_FAULT, rv);
 		}
@@ -2298,7 +2299,7 @@ content_stream_dump( ix_t strmix )
 			free( ( void * )bstatbufp );
 			return mlog_exit(EXIT_FAULT, rv);
 		}
-		ASSERT( rv == RV_OK );
+		assert( rv == RV_OK );
 		if ( rv != RV_OK ) {
 			free( ( void * )bstatbufp );
 			return mlog_exit(EXIT_FAULT, rv);
@@ -2334,7 +2335,7 @@ content_stream_dump( ix_t strmix )
 				free( ( void * )bstatbufp );
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			ASSERT( rv == RV_OK );
+			assert( rv == RV_OK );
 			if ( rv != RV_OK ) {
 				free( ( void * )bstatbufp );
 				return mlog_exit(EXIT_FAULT, rv);
@@ -2394,7 +2395,7 @@ content_stream_dump( ix_t strmix )
 				free( ( void * )bstatbufp );
 				return mlog_exit(EXIT_FAULT, rv);
 			}
-			ASSERT( rv == RV_OK || rv == RV_NOMORE );
+			assert( rv == RV_OK || rv == RV_NOMORE );
 			if ( rv != RV_OK && rv != RV_NOMORE ) {
 				free( ( void * )bstatbufp );
 				return mlog_exit(EXIT_FAULT, rv);
@@ -2737,7 +2738,7 @@ content_mediachange_query( void )
 	}
 	nochangeix = choicecnt;
 	choicestr[ choicecnt++ ] = "continue";
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	responseix = dlog_multi_query( querystr,
 				       querycnt,
 				       choicestr,
@@ -2755,7 +2756,7 @@ content_mediachange_query( void )
 		clr_mcflag( choicetothrdmap[ responseix ].thrdix );
 		return "media change acknowledged\n";
 	}
-	ASSERT( responseix == nochangeix );
+	assert( responseix == nochangeix );
 	return "continuing\n";
 }
 
@@ -2919,7 +2920,7 @@ dump_dir( ix_t strmix,
 
 	/* no way this can be non-dir, but check anyway
 	 */
-	ASSERT( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
+	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
 	if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
 		return RV_OK;
 	}
@@ -3041,7 +3042,7 @@ dump_dir( ix_t strmix,
 		      nread > 0
 		      ;
 		      nread -= ( intgen_t )reclen,
-		      ASSERT( nread >= 0 ),
+		      assert( nread >= 0 ),
 		      p = ( struct dirent * )( ( char * )p + reclen ),
 		      reclen = ( size_t )p->d_reclen ) {
 			xfs_ino_t ino;
@@ -3056,7 +3057,7 @@ dump_dir( ix_t strmix,
 			 * be null-terminated, but the record may have
 			 * padding after the null-termination.
 			 */
-			ASSERT( namelen < nameszmax );
+			assert( namelen < nameszmax );
 #endif
 
 			/* skip "." and ".."
@@ -3263,7 +3264,7 @@ dump_extattr_list( drive_t *drivep,
 
 	/* sanity checks
 	 */
-	ASSERT( listp->al_count >= 0 );
+	assert( listp->al_count >= 0 );
 
 	/* fill up a retrieve array and build a dump buffer;
 	 * can run out of entries in the name list, space in the
@@ -3397,7 +3398,7 @@ dump_extattr_list( drive_t *drivep,
 		if (dumpbufp <= dumpbufendp)
 			continue;	/* no buffer overflow yet */
 
-		ASSERT( endp > contextp->cc_extattrdumpbufp );
+		assert( endp > contextp->cc_extattrdumpbufp );
 		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
 
 		rval = write_buf( contextp->cc_extattrdumpbufp,
@@ -3476,7 +3477,7 @@ dump_extattr_list( drive_t *drivep,
 				continue;
 			}
 
-			ASSERT( endp > contextp->cc_extattrdumpbufp );
+			assert( endp > contextp->cc_extattrdumpbufp );
 			bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
 
 			rval = write_buf( contextp->cc_extattrdumpbufp,
@@ -3613,7 +3614,7 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
 
 	memset( ( void * )&tmpah, 0, sizeof( tmpah ));
 	tmpah.ah_sz = recsz;
-	ASSERT( EXTATTRHDR_SZ + namesz < UINT16MAX );
+	assert( EXTATTRHDR_SZ + namesz < UINT16MAX );
 	tmpah.ah_valoff = ( u_int16_t )( EXTATTRHDR_SZ + namesz );
 	tmpah.ah_flags = ( u_int16_t )
 		(( flag & ATTR_ROOT ) ? EXTATTRHDR_FLAGS_ROOT :
@@ -3644,7 +3645,7 @@ dump_extattrhdr( drive_t *drivep,
 
 	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
 	ahdr.ah_sz = recsz;
-	ASSERT( valoff < UINT16MAX );
+	assert( valoff < UINT16MAX );
 	ahdr.ah_valoff = ( u_int16_t )valoff;
 	ahdr.ah_flags = ( u_int16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
 	ahdr.ah_valsz = valsz;
@@ -3937,7 +3938,7 @@ dump_file_reg( drive_t *drivep,
 	 */
 	if ( statp->bs_ino == startptp->sp_ino ) {
 		offset = startptp->sp_offset;
-		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
 	} else {
 		offset = 0;
 	}
@@ -3966,7 +3967,7 @@ dump_file_reg( drive_t *drivep,
 				break;
 			}
 		}
-		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
 	}
 		
 	/* determine the offset within the file where the dump should end.
@@ -4034,7 +4035,7 @@ dump_file_reg( drive_t *drivep,
 		/* see if we are done.
 		 */
 		if ( cmpltflg ) {
-			ASSERT( rv == RV_OK );
+			assert( rv == RV_OK );
 			break;
 		}
 
@@ -4094,7 +4095,7 @@ dump_file_reg( drive_t *drivep,
 					&offset,
 					&bc,
 					&cmpltflg );
-		ASSERT( bc >= 0 );
+		assert( bc >= 0 );
 		bytecnt += bc;
 		if ( rv != RV_OK ) {
 			break;
@@ -4193,7 +4194,7 @@ dump_file_spec( drive_t *drivep,
 
 		/* null-terminate the string
 		 */
-		ASSERT( ( size_t )nread < contextp->cc_readlinkbufsz );
+		assert( ( size_t )nread < contextp->cc_readlinkbufsz );
 		contextp->cc_readlinkbufp[ nread ] = 0;
 
 		/* calculate the extent size - be sure to include room
@@ -4202,7 +4203,7 @@ dump_file_spec( drive_t *drivep,
 		extentsz = ( ( size_t )nread + 1 + ( SYMLINK_ALIGN - 1 ))
 			   &
 			   ~ ( SYMLINK_ALIGN - 1 );
-		ASSERT( extentsz <= contextp->cc_readlinkbufsz );
+		assert( extentsz <= contextp->cc_readlinkbufsz );
 
 		/* dump an extent header
 		 */
@@ -4351,7 +4352,7 @@ dump_extent_group( drive_t *drivep,
 	 */
 	nextoffset = *nextoffsetp;
 	bytecnt = 0;
-	ASSERT( ( nextoffset & ( BBSIZE - 1 )) == 0 );
+	assert( ( nextoffset & ( BBSIZE - 1 )) == 0 );
 
 	for ( ; ; ) {
 		off64_t offset;
@@ -4398,7 +4399,7 @@ dump_extent_group( drive_t *drivep,
 		if ( gcp->eg_nextbmapp >= gcp->eg_endbmapp ) {
 			intgen_t entrycnt; /* entries in new bmap */
 
-			ASSERT( gcp->eg_nextbmapp == gcp->eg_endbmapp );
+			assert( gcp->eg_nextbmapp == gcp->eg_endbmapp );
 
 			/* get a new extent block
 			 */
@@ -4613,7 +4614,7 @@ dump_extent_group( drive_t *drivep,
 			      extsz,
 			      nextoffset );
 		}
-		ASSERT( extsz > 0 );
+		assert( extsz > 0 );
 
 		/* if the resultant extent would put us over maxcnt,
 		 * shorten it, and round up to the next BBSIZE (round 
@@ -4692,8 +4693,8 @@ dump_extent_group( drive_t *drivep,
 		 */
 		if ( sosig && ( extsz > stopoffset - offset )) {
 			extsz = stopoffset - offset;
-			ASSERT( extsz >= 0 );
-			ASSERT( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
+			assert( extsz >= 0 );
+			assert( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
 			mlog( MLOG_NITTY,
 			      "adjusted top of extent "
 			      "to adhere to stop offset: "
@@ -4747,8 +4748,8 @@ dump_extent_group( drive_t *drivep,
 		}
 		/* adjust the next offset
 		 */
-		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
-		ASSERT( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
 		nextoffset = offset + extsz;
 
 		/* dump the extent header
@@ -4786,7 +4787,7 @@ dump_extent_group( drive_t *drivep,
 			bufp = ( * dop->do_get_write_buf )( drivep,
 							    reqsz,
 							    &actualsz );
-			ASSERT( actualsz <= reqsz );
+			assert( actualsz <= reqsz );
 			new_off = lseek64( gcp->eg_fd, offset, SEEK_SET );
 			if ( new_off == ( off64_t )( -1 )) {
 				mlog( MLOG_NORMAL, _(
@@ -4810,7 +4811,7 @@ dump_extent_group( drive_t *drivep,
 
 				nread = 0;
 			}
-			ASSERT( ( size_t )nread <= actualsz );
+			assert( ( size_t )nread <= actualsz );
 			mlog( MLOG_NITTY,
 			      "read ino %llu offset %lld sz %d actual %d\n",
 			      statp->bs_ino,
@@ -5103,8 +5104,8 @@ dump_dirent( drive_t *drivep,
 		return RV_OK;
 	}
 
-	ASSERT( sz <= UINT16MAX );
-	ASSERT( sz >= DIRENTHDR_SZ );
+	assert( sz <= UINT16MAX );
+	assert( sz >= DIRENTHDR_SZ );
 
 	outbufp = malloc(sz);
 
@@ -5206,7 +5207,7 @@ dump_session_inv( drive_t *drivep,
 		      "unable to get session inventory to dump\n") );
 		return BOOL_TRUE;
 	}
-	ASSERT( inv_sbufp );
+	assert( inv_sbufp );
 
 	/* modify the write header to indicate the media file type.
 	 */
@@ -5497,18 +5498,18 @@ inv_cleanup( void )
 			      interrupted ? ": interrupted" : "" );
 			if (interrupted) mlog_exit_hint(RV_INTR);
 			ok = inv_stream_close( *inv_stmtp, interrupted );
-			ASSERT( ok );
+			assert( ok );
 		}
 	}
 
 	if ( sc_inv_sestoken != INV_TOKEN_NULL ) {
 		ok = inv_writesession_close( sc_inv_sestoken );
-		ASSERT( ok );
+		assert( ok );
 	}
 
 	if ( sc_inv_idbtoken != INV_TOKEN_NULL ) {
 		ok = inv_close( sc_inv_idbtoken );
-		ASSERT( ok );
+		assert( ok );
 	}
 }
 
@@ -5542,7 +5543,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 
 	/* sanity checks
 	 */
-	ASSERT( BES_INIT == 0 );
+	assert( BES_INIT == 0 );
 
 	mlog( MLOG_DEBUG | MLOG_MEDIA,
 	      "Media op: begin media file\n" );
@@ -5588,7 +5589,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 			mediawrittentopr = BOOL_TRUE;
 			goto changemedia;
 		default:
-			ASSERT( 0 );
+			assert( 0 );
 			return RV_CORE;
 		}
 	}
@@ -5685,11 +5686,11 @@ position:
 				intgen_t status;
 				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
 				      "stream terminator found\n") );
-				ASSERT( contextp->cc_Media_useterminatorpr );
-				ASSERT( dcaps & DRIVE_CAP_BSF ); /* redundant */
+				assert( contextp->cc_Media_useterminatorpr );
+				assert( dcaps & DRIVE_CAP_BSF ); /* redundant */
 				status = 0;
 				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				ASSERT( rval == 0 );
+				assert( rval == 0 );
 				if ( status == DRIVE_ERROR_DEVICE ) {
 					mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
 					      "encountered media error "
@@ -5742,10 +5743,10 @@ position:
 				intgen_t status;
 				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "repositioning to overwrite\n") );
-				ASSERT( dcaps & DRIVE_CAP_BSF );
+				assert( dcaps & DRIVE_CAP_BSF );
 				status = 0;
 				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				ASSERT( rval == 0 );
+				assert( rval == 0 );
 				if ( status == DRIVE_ERROR_DEVICE ) {
 					return RV_DRIVE;
 				}
@@ -5881,7 +5882,7 @@ position:
 				assert( dcaps & DRIVE_CAP_BSF );
 				status = 0;
 				rval = ( * dop->do_bsf )( drivep, 0, &status );
-				ASSERT( rval == 0 );
+				assert( rval == 0 );
 				if ( status == DRIVE_ERROR_DEVICE ) {
 					return RV_DRIVE;
 				}
@@ -5923,7 +5924,7 @@ changemedia:
 	
 	/* first eject the current media object if capability supported
 	 */
-	ASSERT( mediapresentpr != BOOL_UNKNOWN );
+	assert( mediapresentpr != BOOL_UNKNOWN );
 	if ( mediapresentpr == BOOL_TRUE ) {
 		if ( dcaps & DRIVE_CAP_EJECT ) {
 			rval = ( * dop->do_eject_media )( drivep );
@@ -5949,7 +5950,7 @@ changemedia:
 	 */
 	if ( drivecnt > 1 && ! stdoutpiped ) {
 		ix_t thrdix = drivep->d_index;
-		ASSERT( sistr );
+		assert( sistr );
 		mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
 		      "please change media: "
 		      "type %s to confirm media change\n"),
@@ -5983,8 +5984,8 @@ changemedia:
 	goto position;
 
 write:
-	ASSERT( mediapresentpr == BOOL_TRUE );
-	ASSERT( virginmediapr != BOOL_UNKNOWN );
+	assert( mediapresentpr == BOOL_TRUE );
+	assert( virginmediapr != BOOL_UNKNOWN );
 
 	if ( intr_allowed && cldmgr_stop_requested( )) {
 		return RV_INTR;
@@ -6024,8 +6025,8 @@ write:
 		mwhdrp->mh_mediaix++; /* pre-initialized to -1 */
 	}
 
-	ASSERT( mwhdrp->mh_mediaix != ( u_int32_t )( -1 ));
-	ASSERT( mwhdrp->mh_dumpfileix != ( u_int32_t )( -1 ));
+	assert( mwhdrp->mh_mediaix != ( u_int32_t )( -1 ));
+	assert( mwhdrp->mh_dumpfileix != ( u_int32_t )( -1 ));
 
 	/* do not allow interleaving of media files from different xfsdumps.
 	 */
@@ -6090,7 +6091,7 @@ write:
 				}
 			}
 		} else {
-			ASSERT( ! virginmediapr );
+			assert( ! virginmediapr );
 			uuid_copy(mwhdrp->mh_mediaid, mrhdrp->mh_mediaid);
 			( void )strncpyterm( mwhdrp->mh_medialabel,
 					     mrhdrp->mh_medialabel,
@@ -6139,14 +6140,14 @@ Media_mfile_end( drive_t *drivep,
 	mlog( MLOG_DEBUG | MLOG_MEDIA,
 	      "Media op: end media file\n" );
 
-	ASSERT( contextp->cc_Media_begin_entrystate == BES_INVAL );
+	assert( contextp->cc_Media_begin_entrystate == BES_INVAL );
 
 	/* call drive's end_write op to flush the tail of the media file
 	 * if has previously hit EOM, this is moot.
 	 */
 	rval = ( dop->do_end_write )( drivep, ncommittedp );
 	if ( hit_eom ) {
-		ASSERT( ! rval );
+		assert( ! rval );
 		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
 		return RV_EOM;
 	}
@@ -6198,7 +6199,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* query: ask if overwrite ok
@@ -6209,13 +6210,13 @@ retry:
 		 (unsigned int)drivep->d_index );
 	querycnt = 0;
 	querystr[ querycnt++ ] = question;
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	dontix = choicecnt;
 	choicestr[ choicecnt++ ] = "don't overwrite";
 	doix = choicecnt;
 	choicestr[ choicecnt++ ] = "overwrite";
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query( querystr,
@@ -6239,7 +6240,7 @@ retry:
 	} else {
 		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
 	}
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_multi_ack( ackstr,
 			ackcnt );
 
@@ -6248,7 +6249,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
@@ -6336,7 +6337,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* query: ask if overwrite ok
@@ -6350,13 +6351,13 @@ retry:
 		 (unsigned int)drivep->d_index );
 	querycnt = 0;
 	querystr[ querycnt++ ] = question;
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	dontix = choicecnt;
 	choicestr[ choicecnt++ ] = "don't erase";
 	doix = choicecnt;
 	choicestr[ choicecnt++ ] = "erase";
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query( querystr,
@@ -6380,7 +6381,7 @@ retry:
 	} else {
 		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
 	}
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_multi_ack( ackstr,
 			ackcnt );
 
@@ -6389,7 +6390,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
@@ -6448,7 +6449,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	responseix = dlog_string_query( Media_prompt_label_cb,
@@ -6474,7 +6475,7 @@ retry:
 		ackstr[ ackcnt++ ] = "abort\n";
 	}
 
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_string_ack( ackstr,
 			 ackcnt );
 
@@ -6483,7 +6484,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
diff --git a/dump/inomap.c b/dump/inomap.c
index a35059a..7a3069f 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -25,6 +25,7 @@
 #include <time.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -185,7 +186,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
 					       bstatbuflen
 					       *
 					       sizeof( xfs_bstat_t ));
-	ASSERT( bstatbufp );
+	assert( bstatbufp );
 
 	/* count the number of inode groups, which will serve as a
 	 * starting point for the size of the inomap.
@@ -369,7 +370,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
 			} else {
 				ep = &startptp[ startptix + 1 ];
 			}
-			ASSERT( ! p->sp_flags );
+			assert( ! p->sp_flags );
 			mlog( MLOG_VERBOSE | MLOG_INOMAP,
 			      _("stream %u: ino %llu offset %lld to "),
 			      startptix,
@@ -606,8 +607,8 @@ cb_add( void *arg1,
 			cb_hdrsz += ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
 		}
 	} else if ( resumed ) {
-		ASSERT( mode != S_IFDIR );
-		ASSERT( changed );
+		assert( mode != S_IFDIR );
+		assert( changed );
 	} else {
 		if ( mode == S_IFDIR ) {
 			if ( cb_skip_unchanged_dirs ) {
@@ -832,7 +833,7 @@ cb_startpt( void *arg1,
 		return 0;
 	}
 
-	ASSERT( cb_startptix < cb_startptcnt );
+	assert( cb_startptix < cb_startptcnt );
 
 	estimate = estimate_dump_space( statp );
 	cb_accum += estimate + ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
@@ -929,7 +930,7 @@ cb_startpt( void *arg1,
 			}
 			break;
 		default:
-			ASSERT( 0 );
+			assert( 0 );
 			return 1;
 		}
 	} while ( action == ( action_t )BUMP || action == ( action_t )SPLIT );
@@ -1042,7 +1043,7 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 static intgen_t
 inomap_init( intgen_t igrpcnt )
 {
-	ASSERT( sizeof( hnk_t ) == HNKSZ );
+	assert( sizeof( hnk_t ) == HNKSZ );
 
 	/* lastseg must be initialized with -1 offsets since
 	 * no segments have been added yet */
@@ -1483,7 +1484,7 @@ subtreelist_parse( jdm_fshandle_t *fshandlep,
 	for ( subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++ ) {
 		intgen_t cbrval = 0;
 		char *currentpath = subtreebuf[ subtreeix ];
-		ASSERT( *currentpath != '/' );
+		assert( *currentpath != '/' );
 		( void )diriter( fshandlep,
 				 fsfd,
 				 rootstatp,
@@ -1669,7 +1670,7 @@ quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
 		}
 
 		if ( bmap[ 0 ].bmv_entries <= 0 ) {
-			ASSERT( bmap[ 0 ].bmv_entries == 0 );
+			assert( bmap[ 0 ].bmv_entries == 0 );
 			( void )close( fd );
 			return offset_next;
 		}
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 65102e6..bd473e9 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -26,6 +26,7 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -48,7 +49,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 
 	int index = 0;
 	
-	ASSERT ( pred );
+	assert ( pred );
 	fd = retval = init_idb ( pred, bywhat, forwhat, &tok );
 
 	if ( retval == I_DONE ) 
@@ -72,7 +73,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 		return INV_TOKEN_NULL;
 	}
 
-	ASSERT ( index > 0 );
+	assert ( index > 0 );
 
 	/* Now we need to make sure that this has enough space */
 	INVLOCK( stobjfd, LOCK_SH );
@@ -170,12 +171,12 @@ inv_writesession_open(
 	inv_sestoken_t	sestok;
 	inv_oflag_t     forwhat;
 
-	ASSERT ( tok != INV_TOKEN_NULL );
-	ASSERT ( sesid && fsid && mntpt && devpath );
+	assert ( tok != INV_TOKEN_NULL );
+	assert ( sesid && fsid && mntpt && devpath );
 	forwhat = tok->d_oflag;
 	fd = tok->d_stobj_fd;
-	ASSERT ( forwhat != INV_SEARCH_ONLY );
-	ASSERT ( fd > 0 );
+	assert ( forwhat != INV_SEARCH_ONLY );
+	assert ( fd > 0 );
 
 	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
 		if ( fstab_put_entry( fsid, mntpt, devpath, forwhat ) < 0 ) {
@@ -218,7 +219,7 @@ inv_writesession_open(
 	/* create the writesession, and get ready for the streams to come 
 	   afterwards */
 	rval = stobj_create_session( sestok, fd, sescnt, &ses, &hdr );
-	ASSERT (rval > 0);
+	assert (rval > 0);
 
 
 	INVLOCK( fd, LOCK_UN );
@@ -256,7 +257,7 @@ inv_writesession_close( inv_sestoken_t tok )
 {
 	int		rval;
 	
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 
 	/* now update end_time in the inv index header */
 	rval = idx_put_sesstime( tok, INVT_ENDTIME );
@@ -287,7 +288,7 @@ inv_stream_open(
 	int fd;
 	bool_t err = BOOL_FALSE;
 
-	ASSERT ( tok != INV_TOKEN_NULL );
+	assert ( tok != INV_TOKEN_NULL );
 	 
 	/* this memset is needed as a dump interrupted/crashed very soon
 	 * after starting results in an inventory with exteremely large
@@ -446,9 +447,9 @@ inv_put_mediafile(
 	int 		 rval;
 
 
-	ASSERT ( tok != INV_TOKEN_NULL );
-	ASSERT ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
-	ASSERT ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
+	assert ( tok != INV_TOKEN_NULL );
+	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
+	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
 
 	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
 	
@@ -512,8 +513,8 @@ inv_get_sessioninfo(
 	int		fd;
 
 
-	ASSERT( tok != INV_TOKEN_NULL );
-	ASSERT( tok->sd_invtok );
+	assert( tok != INV_TOKEN_NULL );
+	assert( tok->sd_invtok );
 	*bufpp = NULL;
 	*bufszp = 0;
 	fd = tok->sd_invtok->d_stobj_fd;
@@ -579,8 +580,8 @@ inv_free_session(
 {
 	uint i;
 	
-	ASSERT(ses);
-	ASSERT(*ses);
+	assert(ses);
+	assert(*ses);
 
 	for ( i = 0; i < (*ses)->s_nstreams; i++ ) {
 		/* the array of mediafiles is contiguous */
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 3f7edb6..a83e7ef 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -25,6 +25,7 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/dir.h>
+#include <assert.h>
 #include "types.h"
 #include "inv_priv.h"
 
@@ -44,7 +45,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 {
 	/* object must be locked at least SHARED by caller */
 	u_int num;
-	ASSERT( cntsz >= sizeof( invt_counter_t ) );
+	assert( cntsz >= sizeof( invt_counter_t ) );
 
 	*cntpp =  calloc( 1, cntsz);
 
@@ -62,7 +63,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 		      "INV : Unknown version %d - Expected version %d\n"),
 		      (int) ( (invt_counter_t *)(*cntpp))->ic_vernum,
 		      (int) INV_VERSION );
-		ASSERT ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
+		assert ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
 			INV_VERSION );
 	} 
 
@@ -110,7 +111,7 @@ get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 {
 	int  nread;
 	
-	ASSERT ( fd >= 0 );
+	assert ( fd >= 0 );
 	
 	if ( dolock ) 
 		INVLOCK( fd, LOCK_SH );
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index f77eeec..34b7aac 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
+#include <assert.h>
 
 
 /*----------------------------------------------------------------------*/
@@ -50,28 +51,28 @@ static char inv_lockfilep[MGR_PATH_MAX];
 char *
 inv_dirpath( void )
 {
-	ASSERT(inv_base);
+	assert(inv_base);
 	return inv_dirpathp;
 }
 
 char *
 inv_fstab( void )
 {
-	ASSERT(inv_base);
+	assert(inv_base);
 	return inv_fstabp;
 }
 
 char *
 inv_lockfile( void )
 {
-	ASSERT(inv_base);
+	assert(inv_base);
 	return inv_lockfilep;
 }
 
 char *
 inv_basepath( void )
 {
-	ASSERT(inv_base);
+	assert(inv_base);
 	return inv_base;
 }
 
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 6567846..e87152f 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/dir.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -88,7 +89,7 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 	invt_fstab_t *arr;
 	int rval = 1;
 
-	ASSERT( forwhat != INV_SEARCH_ONLY );
+	assert( forwhat != INV_SEARCH_ONLY );
 
 	/* fd is locked on succesful return */
 	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
@@ -229,7 +230,7 @@ fstab_get_fname( void *pred,
 	if ( bywhat != INV_BY_UUID ) 
 		free ( arr );
 
-	ASSERT( (int) strlen( fname ) < INV_STRLEN );
+	assert( (int) strlen( fname ) < INV_STRLEN );
 	return 1;
 }	
 	
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 145745a..edb72b3 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -25,6 +25,7 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
+#include <assert.h>
 #include "types.h"
 #include "mlog.h"
 #include "inv_priv.h"
@@ -119,7 +120,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 				   We choose the former. */
 				
 				/* the timeperiods had better not overlap */
-				ASSERT(( tm > iarr[i].ie_timeperiod.tp_end ) &&
+				assert(( tm > iarr[i].ie_timeperiod.tp_end ) &&
 				       ( tm < iarr[i+1].ie_timeperiod.tp_start ));
 
 				/* shift everything from (i+1) onwards by 
@@ -134,7 +135,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 	}		
 
 	/* We couldnt find anything that fits */
-	ASSERT( 0 );	/* We can't get here ! */
+	assert( 0 );	/* We can't get here ! */
 	return -1;
 
 	
@@ -255,7 +256,7 @@ idx_create( char *fname, inv_oflag_t forwhat )
 
 	/* This is not to be called when the user wants to open
 	   the db for SEARCH_ONLY. */
-	ASSERT( forwhat != INV_SEARCH_ONLY );
+	assert( forwhat != INV_SEARCH_ONLY );
 
 	if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
 		INV_PERROR ( fname );
@@ -477,8 +478,8 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
 		return -1;
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	ASSERT ( ent != NULL );	
-	ASSERT ( ent->ie_filename );
+	assert ( ent != NULL );	
+	assert ( ent->ie_filename );
 
 	fd = open( ent->ie_filename, INV_OFLAG(forwhat) );
 	if ( fd < 0 )
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 1f4a425..926b4c8 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
+#include <assert.h>
 #include "types.h"
 #include "mlog.h"
 #include "inv_priv.h"
@@ -150,7 +151,7 @@ invmgr_query_all_sessions (
 
 	/* if on return, this is still null, the search failed */
 	*outarg = NULL; 
-	ASSERT(inarg);
+	assert(inarg);
 
 	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
 	/* special case missing file: ok, outarg says zero */
@@ -725,7 +726,7 @@ bool_t
 invmgr_trylock( invt_mode_t mode )
 {
 	int md;
-	ASSERT( invlock_fd >= 0 );
+	assert( invlock_fd >= 0 );
 	
 	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX: LOCK_SH;
 
@@ -738,7 +739,7 @@ invmgr_trylock( invt_mode_t mode )
 void
 invmgr_unlock( void )
 {
-	ASSERT( invlock_fd >= 0 );
+	assert( invlock_fd >= 0 );
 	
 	INVLOCK( invlock_fd, LOCK_UN );	
 
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index a124b07..b6cd61d 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -18,6 +18,7 @@
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
+#include <assert.h>
 
 #include "inv_priv.h"
 #include "inv_oref.h"
@@ -34,8 +35,8 @@ oref_resolve_(
 	intgen_t rval;
 
 	type &= INVT_OTYPE_MASK;
-	ASSERT(type);
-	ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
+	assert(type);
+	assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
 
 	switch (type) {
 	      case INVT_OTYPE_INVIDX:
@@ -51,7 +52,7 @@ oref_resolve_(
 		break;
 
 	      default:
-		ASSERT(0);
+		assert(0);
 		break;
 	}
 	
@@ -73,12 +74,12 @@ oref_resolve_upto(
 {
 	intgen_t rval = INV_OK;
 
-	ASSERT (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
-	ASSERT (OREF_ISLOCKED(obj));
+	assert (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
+	assert (OREF_ISLOCKED(obj));
 
 	/* we arent interested in anything else */
 	type &= INVT_RES_MASK;
-	ASSERT(type);
+	assert(type);
 
 	if (type >= INVT_RES_COUNTERS) {
 		rval = oref_resolve_counters(obj);
@@ -111,11 +112,11 @@ oref_resolve_entries(
 	if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
 		return INV_OK;
 
-	ASSERT(! OREF_ISRESOLVED(INVT_OTYPE_STOBJ));
+	assert(! OREF_ISRESOLVED(INVT_OTYPE_STOBJ));
 
 	if (OREF_ISRESOLVED(INVT_OTYPE_INVIDX)) {
 		invt_entry_t *ent;
-		ASSERT(OREF_CNT_CURNUM(obj));
+		assert(OREF_CNT_CURNUM(obj));
 
 		if (GET_ENTRIES(obj->fd, &ent, OREF_CNT_CURNUM(obj),
 				sizeof(invt_entry_t)) < 0){
@@ -125,7 +126,7 @@ oref_resolve_entries(
 	}
 	else {
 		invt_fstab_t *ent;
-		ASSERT(OREF_CNT_CURNUM(obj));
+		assert(OREF_CNT_CURNUM(obj));
 		if (GET_ENTRIES(obj->fd, &ent, OREF_CNT_CURNUM(obj),
 				sizeof(invt_fstab_t)) < 0){
 			return INV_ERR;
@@ -184,10 +185,10 @@ oref_sync(
 	intgen_t rval;
 
 	type &= INVT_RES_MASK;
-	ASSERT(type);
-	ASSERT(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
-	ASSERT(OREF_ISRESOLVED(obj, type));
-	ASSERT(OREF_ISLOCKED(obj));
+	assert(type);
+	assert(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
+	assert(OREF_ISRESOLVED(obj, type));
+	assert(OREF_ISLOCKED(obj));
 
 	switch (type) {
 	      case INVT_RES_COUNTERS:
@@ -199,7 +200,7 @@ oref_sync(
 		break;
 
 	      case INVT_RES_ENTRIES:
-		ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
+		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
 
 		rval = PUT_REC_NOLOCK(obj->fd, 
 				      OREF_ENTRIES(obj), 
@@ -209,7 +210,7 @@ oref_sync(
 		break;
 
 	      default:
-		ASSERT(0);
+		assert(0);
 		break;
 	}
 	
@@ -226,13 +227,13 @@ oref_sync_append(
 	intgen_t rval;
 
 	type &= INVT_RES_MASK;
-	ASSERT(type);
-	ASSERT(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
-	ASSERT(OREF_ISLOCKED(obj));
+	assert(type);
+	assert(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
+	assert(OREF_ISLOCKED(obj));
 
 	switch (type) {
 	      case INVT_RES_ENTRIES:
-		ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
+		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
 		
 		rval = PUT_REC_NOLOCK(obj->fd, 
 				      entry,
@@ -245,7 +246,7 @@ oref_sync_append(
 		break;
 
 	      default:
-		ASSERT(0);
+		assert(0);
 		break;
 	}
 	
@@ -314,7 +315,7 @@ oref_resolve(
 	invt_oref_t	*stobj;
 	int		index;
 
-	ASSERT(! OREF_ISRESOLVED(invidx, INVT_OTYPE_MASK));
+	assert(! OREF_ISRESOLVED(invidx, INVT_OTYPE_MASK));
 	
 	OREF_SET_TYPE(invidx, INVT_OTYPE_INVIDX);
 
@@ -393,7 +394,7 @@ oref_resolve_child(
 	int		*index)
 {
 	invt_entry_t 	*ent;
-	ASSERT(OREF_IS_LOCKED(invidx));
+	assert(OREF_IS_LOCKED(invidx));
 
 	if (oref_resolve_upto(invidx, INVT_RES_ENTRIES) == INV_ERR)	
 		return INV_ERR;
@@ -402,8 +403,8 @@ oref_resolve_child(
 	
 	/* at this point we know that there should be at least one invindex
 	   entry present */
-	ASSERT ( ent != NULL );	
-	ASSERT ( ent->ie_filename );
+	assert ( ent != NULL );	
+	assert ( ent->ie_filename );
 
 	fd = open( ent->ie_filename, O_RDWR );
 	if ( fd < 0 ) {
@@ -462,7 +463,7 @@ oref_resolve_new_stobj(
 	invt_oref_t	*stobj;
 	inv_idbtoken_t	tok;
 
-	ASSERT(OREF_ISLOCKED(invidx));
+	assert(OREF_ISLOCKED(invidx));
 
 	memset ( &ent, 0, sizeof( ent ) );
 	stobj = calloc(1, sizeof(invt_oref_t));
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 5f4ed68..2562500 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -158,48 +158,48 @@ typedef struct invt_oref {
         { (oref)->token = tok; }
 
 #define OREF_SET_CNT(oref, cnt) \
-	{ ASSERT (OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
+	{ assert (OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
 	  ((oref)->type & INVT_OTYPE_STOBJ) ? \
 	  (oref)->cu_sescnt = (cnt): (oref)->cu_cnt = (cnt); \
 	  (oref)->type |= INVT_RES_COUNTERS; }
 
 #define OREF_SET_ENTRIES(oref, ents) \
-        { ASSERT ((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB));\
-	  ASSERT ((oref)->type & INVT_RES_COUNTERS); \
+        { assert ((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB));\
+	  assert ((oref)->type & INVT_RES_COUNTERS); \
 	  ((oref)->type & INVT_OTYPE_INVIDX) ? \
 	  (oref)->eu_ent = ents : (oref)->eu_fstabent = ents; \
 	  (oref)->type |= INVT_RES_ENTRIES; }
 
 #define OREF_SET_HDRS(oref, hdrs) \
-        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
-	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
+        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_hdr = hdrs; \
 	   (oref)->type |= INVT_STOBJ_RES_HDRS; }
 
 #define OREF_SET_SESSIONS(oref, ses) \
-        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
-	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
+        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_ses = ses; \
 	   (oref)->type |= INVT_STOBJ_RES_SESSIONS; }
 
 #define OREF_SET_STRMS(oref, strms) \
-        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
-	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
+        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
+	   assert ((oref)->type & INVT_RES_COUNTERS); \
 	   (oref)->eu_strm = strms; \
 	   (oref)->type |= INVT_STOBJ_RES_STRMS; }
 
 #define OREF_SET_CHILD(oref, stobjref) \
-        {  ASSERT (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	   (oref)->ku_child = stobjref; \
 	   (oref)->type |= INVT_RES_CHILD; }
 
 #define OREF_SET_PARENT(oref, invidxref) \
-        {  ASSERT (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
+        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
 	   (oref)->ku_parent = invidxref; \
 	   (oref)->type |= INVT_RES_PARENT; }
 
 #define OREF_UNRESOLVE_CHILD(oref) \
-        {  ASSERT (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
+        {  assert (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
 	   close((oref)->ku_child->fd); \
 	   OREF_DESTROY((oref)->ku_child); \
 	   (oref)->ku_child = 0; \
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index becac17..42969b1 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -26,6 +26,7 @@
 #include <sys/stat.h>
 #include <sys/dir.h>
 #include <sys/mman.h>
+#include <assert.h>
 
 #include "types.h"
 #include "timeutil.h"
@@ -168,7 +169,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	if ( GET_SESHEADERS( fd, &harr, ns ) < 0 )
 		return -1;
 	
-	ASSERT( harr != NULL );
+	assert( harr != NULL );
 
 	if ( ( ix = stobj_find_splitpoint( fd, harr, ns, 
 				       newsess->seshdr->sh_time ) ) == 0 )
@@ -390,7 +391,7 @@ stobj_sortheaders( int fd, u_int num )
 	if ( num < 2 ) return 1;
 
 	hdrs = malloc( sz );
-	ASSERT( hdrs );
+	assert( hdrs );
 
 	if ( GET_REC_NOLOCK( fd, hdrs, sz, STOBJ_OFFSET( 0, 0 ) ) < 0 ) {
 		free ( hdrs );
@@ -505,7 +506,7 @@ stobj_makefname( char *fname )
 	strcat( fname, str );
 	strcat( fname, INV_STOBJ_PREFIX );
 
-	ASSERT( (int) strlen( fname ) < INV_STRLEN );
+	assert( (int) strlen( fname ) < INV_STRLEN );
 }
 
 
@@ -571,7 +572,7 @@ stobj_create_session(
 {
 	off64_t hoff;
 	
-	ASSERT( tok && sescnt && ses && hdr );
+	assert( tok && sescnt && ses && hdr );
 
 	hdr->sh_sess_off = -1;
 	ses->s_cur_nstreams = 0;
@@ -759,7 +760,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 
 	/* Now we know how big this entire thing is going to be */
 	sesbufcp = sesbuf = calloc( 1, sessz );
-	ASSERT( sesbuf );
+	assert( sesbuf );
 
 	/* Copy everything. Note that we don't bother to adjust the offsets
 	   either in the seshdr or in the mediafiles, because we don't need
@@ -801,7 +802,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 		for ( j = 0; j < strms[i].st_nmediafiles; 
 		     j++, 
 		     off = mf.mf_nextmf ) {
-			ASSERT( off );
+			assert( off );
 			if ( GET_REC_NOLOCK( fd, &mf, 
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
@@ -941,7 +942,7 @@ stobj_delete_mobj(int fd,
 /*  The prob is that we need to keep track of where we got these mfiles from
     as we get them, or we wont know how to put them back if they are dirty.
 */
-			ASSERT( off );
+			assert( off );
 			if ( GET_REC_NOLOCK( fd, mf, 
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
@@ -1005,7 +1006,7 @@ stobj_unpack_sessinfo(
 	char	         *tmpbuf;
 	char 		 *p = (char *)bufp;
 	
-	ASSERT ( bufp );
+	assert ( bufp );
 	
 	tmpbuf = (char *)malloc(bufsz);
 
@@ -1109,7 +1110,7 @@ stobj_unpack_sessinfo(
 		      (int)( p - (char *) bufp ), (int) bufsz,
 	      (int) ( sizeof( invt_entry_t ) ) );
 	}
-	ASSERT( (size_t) ( p - (char *) bufp ) == bufsz );
+	assert( (size_t) ( p - (char *) bufp ) == bufsz );
 	
 	return BOOL_TRUE;
 }
@@ -1238,12 +1239,12 @@ stobj_copy_invsess(int fd,
 		if (nmf)
 			ises->s_streams[i].st_mediafiles = calloc( nmf,
 						    sizeof( inv_mediafile_t ) );
-		ASSERT( !nmf || ises->s_streams[i].st_mediafiles );
+		assert( !nmf || ises->s_streams[i].st_mediafiles );
 
 		for ( j = 0; j < nmf; 
 		      j++, 
 		      off = mf.mf_nextmf ) {
-			ASSERT( off );
+			assert( off );
 			if ( GET_REC_NOLOCK( fd, &mf, 
 					     sizeof( invt_mediafile_t ),
 					     off ) <= 0 ) {
diff --git a/inventory/testmain.c b/inventory/testmain.c
index cfd0654..d8c61e2 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -22,6 +22,7 @@
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <assert.h>
 #include "types.h"
 #include "mlog.h"
 #include "getopt.h"
@@ -92,12 +93,12 @@ recons_test( int howmany )
 		rval = get_invtrecord( fd, &sarr[i], 
 				       sizeof( uuid_t ) + sizeof( size_t ), 0,
 				       SEEK_CUR, BOOL_FALSE );
-		ASSERT( rval > 0 );
-		ASSERT( sarr[i].sz > 0 );
+		assert( rval > 0 );
+		assert( sarr[i].sz > 0 );
 		sarr[i].buf = calloc( 1,  sarr[i].sz );
 		rval = get_invtrecord( fd, sarr[i].buf,  sarr[i].sz, 0, SEEK_CUR,
 				       BOOL_FALSE );
-		ASSERT( rval > 0 );
+		assert( rval > 0 );
 	}
 	
 	
@@ -263,9 +264,9 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 	printf("first time!\n");
 	for (i=0; i<8; i++) {
 		uuid_create( &fsidarr[i], &stat );
-		ASSERT ( stat == uuid_s_ok );
+		assert ( stat == uuid_s_ok );
 		uuid_create( &sesidarr[i], &stat );
-		ASSERT ( stat == uuid_s_ok );
+		assert ( stat == uuid_s_ok );
 	}
 	fd = open( "uuids", O_RDWR | O_CREAT );
 	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L );
@@ -289,7 +290,7 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 		dev = dev_str[7];
 		fsidp = &fsidarr[0]; /* j */
 		tok1 = inv_open( INV_BY_UUID, INV_SEARCH_N_MOD, fsidp );
-		ASSERT (tok1 != INV_TOKEN_NULL );
+		assert (tok1 != INV_TOKEN_NULL );
 
 		uuid_create( &labelid, &stat );
 		uuid_to_string( &labelid, &str, &stat );
@@ -306,10 +307,10 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 					     dumplevel, nstreams, 
 					     time(NULL),
 					     mnt, dev );
-		ASSERT (tok2 != INV_TOKEN_NULL );
+		assert (tok2 != INV_TOKEN_NULL );
 		for (m = 0; m<nstreams; m++) {
 			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			ASSERT (tok3 != INV_TOKEN_NULL );
+			assert (tok3 != INV_TOKEN_NULL );
 
 			for (k = 0; k<nmedia; k++ )
 				CREAT_mfiles( tok3, &labelid, k*100,
@@ -353,7 +354,7 @@ mp_test(int nstreams)
 {
 #if 0
 	tok1 = inv_open( INV_BY_UUID, fsidp );
-	ASSERT (tok1 != INV_TOKEN_NULL );
+	assert (tok1 != INV_TOKEN_NULL );
 
 	tok2 = inv_writesession_open(tok1, fsidp,
 				     &labelid,
@@ -363,11 +364,11 @@ mp_test(int nstreams)
 				     dumplevel, nstreams, 
 				     time(NULL),
 				     mnt, dev );
-	ASSERT (tok2 != INV_TOKEN_NULL );
+	assert (tok2 != INV_TOKEN_NULL );
 
 	for (m = 0; m<nstreams; m++) {
 			tok3 = inv_stream_open( tok2,"/dev/rmt");
-			ASSERT (tok3 != INV_TOKEN_NULL );
+			assert (tok3 != INV_TOKEN_NULL );
 
 			for (k = 0; k<nmedia; k++ )
 				CREAT_mfiles( tok3, &labelid, k*100,
@@ -399,7 +400,7 @@ main(int argc, char *argv[])
 
 	progname = argv[0];
 	sesfile = "sessions";
-	ASSERT( argc > 1 );
+	assert( argc > 1 );
 	
 	mlog_init( argc, argv );
 
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index c49e96d..4c108fb 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -30,6 +30,7 @@
 #include <sys/ioctl.h>
 #include <sys/mtio.h>
 #include <sys/param.h>
+#include <assert.h>
 
 /*
  * uses old_mtget IRIX structure since we don't bother
diff --git a/restore/bag.c b/restore/bag.c
index b7d8fe2..8c7a216 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -22,6 +22,7 @@
 #include <sys/types.h>
 #include <stdlib.h>
 #include <memory.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -33,7 +34,7 @@ bag_alloc( void )
 	bag_t *bagp;
 
 	bagp = ( bag_t * )calloc( 1, sizeof( bag_t ));
-	ASSERT( bagp );
+	assert( bagp );
 	return bagp;
 }
 
@@ -46,9 +47,9 @@ bag_insert( bag_t *bagp,
 	register bagelem_t *nextp;
 	register bagelem_t *prevp;
 
-	ASSERT( ! newp->be_loaded );
+	assert( ! newp->be_loaded );
 	newp->be_loaded = BOOL_TRUE;
-	ASSERT( ! newp->be_bagp );
+	assert( ! newp->be_bagp );
 	newp->be_bagp = bagp;
 
 	newp->be_key = key;
@@ -79,8 +80,8 @@ bag_remove( bag_t *bagp,
 	register bagelem_t *nextp;
 	register bagelem_t *prevp;
 
-	ASSERT( oldp->be_loaded );
-	ASSERT( oldp->be_bagp == bagp );
+	assert( oldp->be_loaded );
+	assert( oldp->be_bagp == bagp );
 
 	nextp = oldp->be_nextp;
 	prevp = oldp->be_prevp;
@@ -90,7 +91,7 @@ bag_remove( bag_t *bagp,
 
 	if ( bagp->b_headp == oldp ) {
 		if ( nextp == oldp ) {
-			ASSERT( prevp == oldp );
+			assert( prevp == oldp );
 			bagp->b_headp = 0;
 		} else {
 			bagp->b_headp = nextp;
@@ -121,8 +122,8 @@ bag_find( bag_t *bagp,
 		*payloadpp = 0;
 		return 0;
 	} else {
-		ASSERT( p->be_loaded );
-		ASSERT( p->be_bagp == bagp );
+		assert( p->be_loaded );
+		assert( p->be_bagp == bagp );
 		*payloadpp = p->be_payloadp;
 		return p;
 	}
@@ -182,7 +183,7 @@ bag_free( bag_t *bagp )
 		if ( p == bagp->b_headp ) {
 			break;
 		}
-		ASSERT( p );
+		assert( p );
 	}
 
 	memset( ( void * )bagp, 0, sizeof( bag_t ));
diff --git a/restore/content.c b/restore/content.c
index f2d361b..4796aea 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -34,6 +34,7 @@
 #include <utime.h>
 #include <malloc.h>
 #include <pthread.h>
+#include <assert.h>
 
 #include "types.h"
 #include "timeutil.h"
@@ -912,14 +913,14 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( pers_desc_t ) <= PERS_DESCSZ );
-	ASSERT( PERS_DESCSZ <= pgsz );
-	ASSERT( ! ( pgsz % PERS_DESCSZ ));
-	ASSERT( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
+	assert( sizeof( pers_desc_t ) <= PERS_DESCSZ );
+	assert( PERS_DESCSZ <= pgsz );
+	assert( ! ( pgsz % PERS_DESCSZ ));
+	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
 
-	ASSERT( ! ( perssz % pgsz ));
+	assert( ! ( perssz % pgsz ));
 
-	ASSERT( SYNC_INIT == 0 );
+	assert( SYNC_INIT == 0 );
 
 	mlog( MLOG_NITTY,
 	      "sizeof( pers_desc_t ) == %d, pgsz == %d, perssz == %d \n",
@@ -928,7 +929,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 	/* allocate transient state
 	 */
 	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	ASSERT( tranp );
+	assert( tranp );
 
 	/* allocate a qlock for establishing pi critical regions
 	 */
@@ -1208,7 +1209,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 	/* assume all streams contain a directory dump. streams will remove
 	 * themselves from this bitset if they do not contain a directory dump.
 	 */
-	ASSERT( drivecnt <= sizeof(tranp->t_dirdumps) * NBBY );
+	assert( drivecnt <= sizeof(tranp->t_dirdumps) * NBBY );
 	tranp->t_dirdumps = ( 1ULL << drivecnt ) - 1;
 
 	/* the user may specify stdin as the restore source stream,
@@ -1329,7 +1330,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 
 	/* build a full pathname to pers. state file
 	 */
-	ASSERT( ! perspath );
+	assert( ! perspath );
 	perspath = open_pathalloc( tranp->t_hkdir, persname, 0 );
 
 	/* open, creating if non-existent
@@ -1596,11 +1597,11 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 		intgen_t rval;
 
 		path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-		ASSERT( path1 );
+		assert( path1 );
 		path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-		ASSERT( path2 );
-		ASSERT( persp->a.valpr );
-		ASSERT( persp->s.valpr );
+		assert( path2 );
+		assert( persp->a.valpr );
+		assert( persp->s.valpr );
 		rval = chdir( persp->a.dstdir );
 		if ( rval ) {
 			mlog( MLOG_NORMAL, _(
@@ -1673,7 +1674,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 		stpgcnt = persp->a.stpgcnt;
 		newstpgcnt = stpgcnt;
 		descpgcnt = persp->s.descpgcnt;
-		ASSERT( resumepr );
+		assert( resumepr );
 		mlog( MLOG_VERBOSE, _(
 		      "resuming restore previously begun %s\n"),
 		      ctimennl( &persp->s.begintime ));
@@ -1683,13 +1684,13 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 	/* unmap temp mapping of hdr, truncate, and remap hdr/subtrees
 	 */
 	rval = munmap( ( void * )persp, perssz );
-	ASSERT( ! rval );
+	assert( ! rval );
 	rval = ftruncate( tranp->t_persfd, ( off_t )perssz
 					   +
 					   ( off_t )( stpgcnt + descpgcnt )
 					   *
 					   ( off_t )pgsz );
-	ASSERT( ! rval );
+	assert( ! rval );
 	stpgcnt = newstpgcnt;
 	persp = ( pers_t * ) mmap_autogrow( perssz + stpgcnt * pgsz,
 				   tranp->t_persfd, 0);
@@ -1756,7 +1757,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 					+
 					( STDESCALIGN - 1 );
 				stdsz &= ~( STDESCALIGN - 1 );
-				ASSERT( stdsz <= ( size_t )OFFMAX );
+				assert( stdsz <= ( size_t )OFFMAX );
 				stdescp->std_nextoff = ( off_t )stdsz;
 				strcpy( stdescp->std_path, optarg );
 				stdescp = ( stdesc_t * )
@@ -1765,7 +1766,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 				break;
 			}
 		}
-		ASSERT( stcnt == 0 );
+		assert( stcnt == 0 );
 	}
 
 	/* initialize the local extattr abstraction. must be done even if
@@ -1801,7 +1802,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 	 * referenced ONLY via the macros provided; the descriptors will be
 	 * occasionally remapped, causing the ptr to change.
 	 */
-	ASSERT( ! descp );
+	assert( ! descp );
 	if ( descpgcnt ) {
 		descp = ( pers_desc_t * ) mmap_autogrow( descpgcnt * pgsz,
 						tranp->t_persfd,
@@ -1932,9 +1933,9 @@ content_stream_restore( ix_t thrdix )
 	/* allocate two path buffers
 	 */
 	path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-	ASSERT( path1 );
+	assert( path1 );
 	path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
-	ASSERT( path2 );
+	assert( path2 );
 
 	/* set the current directory to dstdir. the tree abstraction
 	 * depends on the current directory being the root of the
@@ -2081,7 +2082,7 @@ content_stream_restore( ix_t thrdix )
 		      "dump found: checking\n" );
 		matchpr = BOOL_FALSE;
 		resumepr = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME );
-		ASSERT( scrhdrp->cih_level >= 0 );
+		assert( scrhdrp->cih_level >= 0 );
 		level = ( ix_t )scrhdrp->cih_level;
 		baseidp = resumepr
 			  ?
@@ -2246,7 +2247,7 @@ content_stream_restore( ix_t thrdix )
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		dcaps = drivep->d_capabilities;
-		ASSERT( fileh != DH_NULL );
+		assert( fileh != DH_NULL );
 		lock( );
 		if ( tranp->t_sync3 == SYNC_BUSY ) {
 			unlock( );
@@ -2529,7 +2530,7 @@ content_stream_restore( ix_t thrdix )
 			return mlog_exit(EXIT_FAULT, rv);
 		}
 		dcaps = drivep->d_capabilities;
-		ASSERT( fileh > DH_NULL );
+		assert( fileh > DH_NULL );
 		if ( tranp->t_toconlypr ) {
 			mlog( MLOG_VERBOSE, _(
 			      "reading non-directory files\n") );
@@ -2752,7 +2753,7 @@ content_statline( char **linespp[ ] )
 			 percent,
 			 (unsigned long long)tranp->t_direntcnt,
 			 elapsed );
-		ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
+		assert( strlen( statline[ 0 ] ) < STATLINESZ );
 		
 		return 1;
 	}
@@ -2792,7 +2793,7 @@ content_statline( char **linespp[ ] )
 		 (unsigned long long)inocnt,
 		 percent,
 		 elapsed );
-	ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
+	assert( strlen( statline[ 0 ] ) < STATLINESZ );
 	
 	/* return buffer to caller
 	 */
@@ -2880,7 +2881,7 @@ content_mediachange_query( void )
 	}
 	nochangeix = choicecnt;
 	choicestr[ choicecnt++ ] = _("continue");
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	responseix = dlog_multi_query( querystr,
 				       querycnt,
 				       choicestr,
@@ -2920,7 +2921,7 @@ content_mediachange_query( void )
 		choicecnt = 0;
 		nochangeix = choicecnt;
 		choicestr[ choicecnt++ ] = _("continue");
-		ASSERT( choicecnt <= CHOICEMAX );
+		assert( choicecnt <= CHOICEMAX );
 		responseix = dlog_multi_query( querystr,
 					       querycnt,
 					       choicestr,
@@ -2936,7 +2937,7 @@ content_mediachange_query( void )
 					       nochangeix);/* sigquit ix */
 		return _("continuing\n");
 	}
-	ASSERT( responseix == nochangeix );
+	assert( responseix == nochangeix );
 	return _("continuing\n");
 }
 
@@ -3106,7 +3107,7 @@ applydirdump( drive_t *drivep,
 					break;
 				}
 				namelen = strlen( dhdrp->dh_name );
-				ASSERT( namelen <= NAME_MAX );
+				assert( namelen <= NAME_MAX );
 
 				/* add this dirent to the tree.
 				 */
@@ -3263,7 +3264,7 @@ eatdirdump( drive_t *drivep,
 				break;
 			}
 			namelen = strlen( dhdrp->dh_name );
-			ASSERT( namelen <= NAME_MAX );
+			assert( namelen <= NAME_MAX );
 		}
 	}
 
@@ -3525,7 +3526,7 @@ applynondirdump( drive_t *drivep,
 				if ( cur_egrp.eg_ino < next_egrp.eg_ino
 				     ||
 				     next_egrp.eg_off > 0 ) {
-					ASSERT( cur_egrp.eg_ino
+					assert( cur_egrp.eg_ino
 						<=
 						next_egrp.eg_ino );
 					pi_update_stats( bstatp->bs_blocks
@@ -3706,8 +3707,8 @@ wipepersstate( void )
 			       "%s/%s",
 			       tranp->t_hkdir,
 			       direntp->d_name );
-		ASSERT( len > 0 );
-		ASSERT( len < MAXPATHLEN );
+		assert( len > 0 );
+		assert( len < MAXPATHLEN );
 		( void )unlink( pathname );
 		closedir( dirp );
 		dirp = opendir( tranp->t_hkdir );
@@ -3732,7 +3733,7 @@ Inv_validate_cmdline( void )
 	bool_t ok;
 	bool_t rok;
 
-	ASSERT( ! persp->s.valpr );
+	assert( ! persp->s.valpr );
 
 	ok = BOOL_FALSE;
 	sessp = 0;
@@ -3797,7 +3798,7 @@ Media_create( ix_t thrdix )
 	Mediap->M_mrhdrp = mrhdrp;
 	Mediap->M_crhdrp = crhdrp;
 	Mediap->M_scrhdrp = scrhdrp;
-	ASSERT( POS_UNKN == 0 );
+	assert( POS_UNKN == 0 );
 
 	return Mediap;
 }
@@ -4079,7 +4080,7 @@ Media_mfile_next( Media_t *Mediap,
 		case DRIVE_ERROR_EOD:
 			Mediap->M_pos = POS_END;
 			if ( Mediap->M_fsfixvalpr ) {
-				ASSERT( purp != PURP_SEARCH );
+				assert( purp != PURP_SEARCH );
 				pi_hiteod( Mediap->M_fssix,
 					   Mediap->M_fsoix );
 			}
@@ -4087,7 +4088,7 @@ Media_mfile_next( Media_t *Mediap,
 		case DRIVE_ERROR_EOM:
 			Mediap->M_pos = POS_END;
 			if ( Mediap->M_fsfixvalpr ) {
-				ASSERT( purp != PURP_SEARCH );
+				assert( purp != PURP_SEARCH );
 				pi_hiteom( Mediap->M_fssix,
 					   Mediap->M_fsoix );
 			}
@@ -4206,7 +4207,7 @@ validate:
 		/* if the purpose is to search, return this media file
 		 */
 		if ( purp == PURP_SEARCH ) {
-			ASSERT( Mediap->M_pos == POS_ATHDR );
+			assert( Mediap->M_pos == POS_ATHDR );
 			return RV_OK;
 		}
 
@@ -4457,9 +4458,9 @@ validate:
 		/* if the purpose is dir, give it to the caller
 		 */
 		if ( purp == PURP_DIR ) {
-			ASSERT( Mediap->M_pos == POS_ATHDR );
+			assert( Mediap->M_pos == POS_ATHDR );
 			if ( filehp ) {
-				ASSERT( fileh != DH_NULL );
+				assert( fileh != DH_NULL );
 				*filehp = fileh;
 			}
 			return RV_OK;
@@ -4471,9 +4472,9 @@ validate:
 
 		/* see if this media file contains any inodes not yet restored
 		 */
-		ASSERT( fileh != DH_NULL );
+		assert( fileh != DH_NULL );
 		pi_lock( );
-		ASSERT( DH2F( fileh )->f_valpr );
+		assert( DH2F( fileh )->f_valpr );
 		begino = DH2F( fileh )->f_curegrp.eg_ino;
 		endino = pi_scanfileendino( fileh );
 		hassomepr = inomap_rst_needed( begino, endino );
@@ -4532,8 +4533,8 @@ validate:
 		 * and no check point, can still get there
 		 * by doing dummy read of dirdump.
 		 */
-		ASSERT( fileh != DH_NULL );
-		ASSERT( DH2F( fileh )->f_valpr );
+		assert( fileh != DH_NULL );
+		assert( DH2F( fileh )->f_valpr );
 		resumepr = ( ( DH2F( fileh )->f_firstegrp.eg_ino
 			       !=
 			       DH2F( fileh )->f_curegrp.eg_ino )
@@ -4616,7 +4617,7 @@ validate:
 			rval = 0;
 			break;
 		default:
-		    ASSERT( 0 );
+		    assert( 0 );
 		    rval = 1;
 		    break;
 		}
@@ -4634,7 +4635,7 @@ validate:
 		 */
 		if ( ! rval ) {
 			if ( filehp ) {
-				ASSERT( fileh != DH_NULL );
+				assert( fileh != DH_NULL );
 				*filehp = fileh;
 			}
 			return RV_OK;
@@ -4647,7 +4648,7 @@ validate:
 		( * dop->do_end_read )( drivep );
 		Mediap->M_pos = POS_UNKN;
 		fileh = DH_NULL;
-		ASSERT( purp == PURP_NONDIR );
+		assert( purp == PURP_NONDIR );
 		if ( pi_know_no_more_beyond_on_object( purp,
 						       Mediap->M_fssix,
 						       Mediap->M_fsoix,
@@ -4735,7 +4736,7 @@ newmedia:
 							   BOOL_FALSE );
 			break;
 		default:
-			ASSERT( 0 );
+			assert( 0 );
 		}
 
 		if ( ! bagp && ! knownholespr && ! maybeholespr ) {
@@ -4796,7 +4797,7 @@ newmedia:
 					pi_neededobjs_free( bagp );
 					bagp = 0;
 				}
-				ASSERT( sistr );
+				assert( sistr );
 				mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
 				      "please change media: "
 				      "type %s to confirm media change\n"),
@@ -4928,19 +4929,19 @@ pi_allocdesc( dh_t *deschp )
 		/* first unmap if any existing descriptors
 		 */
 		if ( descp ) {
-			ASSERT( olddescpgcnt > 0 );
+			assert( olddescpgcnt > 0 );
 			rval = munmap( ( void * )descp,
 				       olddescpgcnt * pgsz );
-			ASSERT( ! rval );
+			assert( ! rval );
 			descp = 0;
 		} else {
-			ASSERT( olddescpgcnt == 0 );
+			assert( olddescpgcnt == 0 );
 		}
 
 		/* remap with DAU more pages of descriptors
 		 */
-		ASSERT( stpgcnt <= ( ix_t )INTGENMAX );
-		ASSERT( newdescpgcnt > 0 );
+		assert( stpgcnt <= ( ix_t )INTGENMAX );
+		assert( newdescpgcnt > 0 );
 		descp = ( pers_desc_t * ) mmap_autogrow( newdescpgcnt * pgsz,
 						tranp->t_persfd,
 						( off_t )perssz
@@ -4973,7 +4974,7 @@ pi_allocdesc( dh_t *deschp )
 	desch = persp->s.descfreeh;
 	persp->s.descfreeh = DH2D( desch )->d_nexth;
 	memset( ( void * )DH2D( desch ), 0, sizeof( pers_desc_t ));
-	ASSERT( desch != DH_NULL );
+	assert( desch != DH_NULL );
 	*deschp = desch;
 	return BOOL_TRUE;
 }
@@ -5041,7 +5042,7 @@ pi_insertfile( ix_t drivecnt,
 	      strmix++,
 	      strmh = DH2S( strmh )->s_nexth )
 		;
-	ASSERT( strmh != DH_NULL );
+	assert( strmh != DH_NULL );
 
 	/* get handle to this object by walking/constructing this stream's
 	 * object list, up to the desired object
@@ -5124,10 +5125,10 @@ pi_insertfile( ix_t drivecnt,
 	     &&
 	     ! DH2O( prevobjh )->o_lmfknwnpr ) {
 		size_t prevmfcnt;
-		ASSERT( DH2O( objh )->o_fmfsix > DH2O( prevobjh )->o_fmfsix );
+		assert( DH2O( objh )->o_fmfsix > DH2O( prevobjh )->o_fmfsix );
 		prevmfcnt = DH2O( objh )->o_fmfsix - DH2O( prevobjh )->o_fmfsix;
 		pi_unlock( );
-		ASSERT( mediaix > 0 );
+		assert( mediaix > 0 );
 		( void )pi_insertfile( drivecnt,
 				       driveix,
 				       mediaix - 1,
@@ -5190,8 +5191,8 @@ pi_insertfile( ix_t drivecnt,
 	/* update the media file fields not yet valid
 	 */
 	if ( egrpvalpr && ! DH2F( fileh )->f_valpr ) {
-		ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
-		ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
+		assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
+		assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
 		DH2F( fileh )->f_firstegrp.eg_ino = startino;
 		DH2F( fileh )->f_firstegrp.eg_off = startoffset;
 		DH2F( fileh )->f_curegrp = DH2F( fileh )->f_firstegrp;
@@ -5233,7 +5234,7 @@ pi_addfile( Media_t *Mediap,
 	if ( ! persp->s.stat_valpr ) {
 		persp->s.stat_inocnt = scrhdrp->cih_inomap_nondircnt;
 		persp->s.stat_inodone = 0;
-		ASSERT( scrhdrp->cih_inomap_datasz <= OFF64MAX );
+		assert( scrhdrp->cih_inomap_datasz <= OFF64MAX );
 		persp->s.stat_datacnt = ( off64_t )scrhdrp->cih_inomap_datasz;
 		persp->s.stat_datadone = 0;
 		persp->s.stat_valpr = BOOL_TRUE;
@@ -5301,7 +5302,7 @@ pi_addfile( Media_t *Mediap,
 		if ( fileh == DH_NULL ) {
 			return DH_NULL;
 		}
-		ASSERT( drhdrp->dh_drivecnt > 0 );
+		assert( drhdrp->dh_drivecnt > 0 );
 		if ( drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1 ) {
 			/* if this is not in the last stream, we know
 			 * there is at least one other media file in
@@ -5433,12 +5434,12 @@ pi_addfile( Media_t *Mediap,
 						  &rval );
 				switch( rval ) {
 				case 0:
-					ASSERT( nread == ( intgen_t )bufszincr );
+					assert( nread == ( intgen_t )bufszincr );
 					buflen += ( size_t )nread;
 					bufsz += bufszincr;
 					bufp = ( char * )realloc(( void * )bufp,
 								 bufsz );
-					ASSERT( bufp );
+					assert( bufp );
 					continue;
 				case DRIVE_ERROR_EOD:
 				case DRIVE_ERROR_EOF:
@@ -5495,7 +5496,7 @@ pi_addfile( Media_t *Mediap,
 		return fileh;
 	}
 
-	ASSERT( 0 );
+	assert( 0 );
 	return DH_NULL;
 }
 
@@ -5829,7 +5830,7 @@ pi_scanfileendino( dh_t fileh )
 	dh_t strmh;
 	ix_t mode = 0;
 
-	ASSERT( fileh != DH_NULL );
+	assert( fileh != DH_NULL );
 
 	/* traverse the pi tree, looking for the next media file after
 	 */
@@ -5863,13 +5864,13 @@ pi_scanfileendino( dh_t fileh )
 			if ( DH2F( nexth )->f_valpr ) {
 			    xfs_ino_t ino;
 
-			    ASSERT( ! ( DH2F( nexth )->f_flags & PF_INV ));
-			    ASSERT( ! ( DH2F( nexth )->f_flags & PF_TERM ));
+			    assert( ! ( DH2F( nexth )->f_flags & PF_INV ));
+			    assert( ! ( DH2F( nexth )->f_flags & PF_TERM ));
 			    if ( DH2F( nexth )->f_firstegrp.eg_off ) {
 				ino =  DH2F( nexth )->f_firstegrp.eg_ino;
 				return ino;
 			    } else {
-				ASSERT( DH2F( nexth )->f_firstegrp.eg_ino > 0 );
+				assert( DH2F( nexth )->f_firstegrp.eg_ino > 0 );
 				ino =  DH2F( nexth )->f_firstegrp.eg_ino - 1;
 				return ino;
 			    }
@@ -5894,12 +5895,12 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
 	dh_t follh = DH_NULL;
 
 
-	ASSERT( thisfileh != DH_NULL );
+	assert( thisfileh != DH_NULL );
 
 	/* traverse the pi tree, looking for fileh
 	 */
 	pi_lock( );
-	ASSERT( DH2F( thisfileh )->f_valpr );
+	assert( DH2F( thisfileh )->f_valpr );
 
 	for ( strmh = persp->s.strmheadh
 	      ;
@@ -5924,14 +5925,14 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
 			if ( fileh == thisfileh ) {
 			    thisfoundpr = BOOL_TRUE;
 			} else if ( DH2F( fileh )->f_valpr ) {
-			    ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
-			    ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
+			    assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
+			    assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
 			    prech = fileh;
 			}
 		    } else if ( DH2F( fileh )->f_valpr ) {
-			ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
-			ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
-			ASSERT( follh == DH_NULL );
+			assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
+			assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
+			assert( follh == DH_NULL );
 			follh = fileh;
 			goto done;
 		    }
@@ -5940,7 +5941,7 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
 	}
 done:
 
-	ASSERT( thisfoundpr );
+	assert( thisfoundpr );
 
 	/* initially the lower bracket is this file descriptor's
 	 * current egrp. this catches the case where a previous restore
@@ -5979,7 +5980,7 @@ static void
 pi_update_stats( off64_t sz )
 {
 	pi_lock( );
-	ASSERT( persp->s.stat_valpr );
+	assert( persp->s.stat_valpr );
 	persp->s.stat_inodone++;
 	persp->s.stat_datadone += sz;
 	pi_unlock( );
@@ -6011,7 +6012,7 @@ pi_iter_alloc( void )
 	pi_iter_t *iterp;
 
 	iterp = ( pi_iter_t * )calloc( 1, sizeof( pi_iter_t ));
-	ASSERT( iterp );
+	assert( iterp );
 	return iterp;
 }
 
@@ -6026,7 +6027,7 @@ pi_iter_nextfileh( pi_iter_t *iterp,
 		   bool_t *objmissingprp,
 		   bool_t *filemissingprp )
 {
-	ASSERT( ! iterp->donepr );
+	assert( ! iterp->donepr );
 
 	if ( persp->s.strmheadh == DH_NULL ) {
 		iterp->donepr = BOOL_TRUE;
@@ -6034,7 +6035,7 @@ pi_iter_nextfileh( pi_iter_t *iterp,
 	}
 
 	if ( ! iterp->initializedpr ) {
-		ASSERT( persp->s.strmheadh != DH_NULL );
+		assert( persp->s.strmheadh != DH_NULL );
 		iterp->strmh = persp->s.strmheadh;
 		iterp->objh = DH2S( iterp->strmh )->s_cldh;
 		if ( iterp->objh == DH_NULL ) {
@@ -6199,8 +6200,8 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 			headegrp.eg_ino = INO64MAX;
 			headegrp.eg_off = OFF64MAX;
 		} else {
-			ASSERT( ! ( DH2F( headh )->f_flags & PF_INV ));
-			ASSERT( ! ( DH2F( headh )->f_flags & PF_TERM ));
+			assert( ! ( DH2F( headh )->f_flags & PF_INV ));
+			assert( ! ( DH2F( headh )->f_flags & PF_TERM ));
 			headegrp = DH2F( headh )->f_firstegrp;
 		}
 
@@ -6369,15 +6370,15 @@ pi_neededobjs_free( bag_t *bagp )
 	size64_t dummykey;
 	void *dummypayloadp;
 
-	ASSERT( bagp );
+	assert( bagp );
 
 	bagiter_init( bagp, &bagiter );
 
 	bagobjp = 0;
 	while (( bagelemp = bagiter_next( &bagiter, ( void ** )&bagobjp ) )) {
 		bag_remove( bagp, bagelemp, &dummykey, &dummypayloadp );
-		ASSERT( bagobjp );
-		ASSERT( bagobjp == ( bagobj_t * )dummypayloadp );
+		assert( bagobjp );
+		assert( bagobjp == ( bagobj_t * )dummypayloadp );
 		free( ( void * )bagobjp );
 		bagobjp = 0;
 	}
@@ -6441,7 +6442,7 @@ pi_hiteod( ix_t strmix, ix_t objix )
 	      ix++,
 	      strmh = DH2S( strmh )->s_nexth )
 		;
-	ASSERT( strmh != DH_NULL );
+	assert( strmh != DH_NULL );
 
 	/* get index to last object in stream
 	 */
@@ -6451,7 +6452,7 @@ pi_hiteod( ix_t strmix, ix_t objix )
 	      ;
 	      objh = DH2O( objh )->o_nexth, objcnt++ )
 		;
-	ASSERT( objcnt != 0 );
+	assert( objcnt != 0 );
 	lastobjix = objcnt - 1;
 	
 	pi_unlock( );
@@ -6504,7 +6505,7 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
 	      ix++,
 	      strmh = DH2S( strmh )->s_nexth )
 		;
-	ASSERT( strmh != DH_NULL );
+	assert( strmh != DH_NULL );
 
 	/* get index to last object in stream
 	 */
@@ -6514,7 +6515,7 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
 	      ;
 	      objh = DH2O( objh )->o_nexth, objcnt++ )
 		;
-	ASSERT( objcnt != 0 );
+	assert( objcnt != 0 );
 	lastobjix = objcnt - 1;
 	
 	pi_unlock( );
@@ -6549,7 +6550,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
 	dh_t objh;
 	dh_t fileh;
 
-	ASSERT( purp == PURP_DIR || purp == PURP_NONDIR );
+	assert( purp == PURP_DIR || purp == PURP_NONDIR );
 
 	pi_lock( );
 
@@ -6563,7 +6564,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
 	      ix++,
 	      strmh = DH2S( strmh )->s_nexth )
 		;
-	ASSERT( strmh != DH_NULL );
+	assert( strmh != DH_NULL );
 
 	/* get handle to indexed object
 	 */
@@ -6574,7 +6575,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
 	      ix++,
 	      objh = DH2O( objh )->o_nexth )
 		;
-	ASSERT( objh != DH_NULL );
+	assert( objh != DH_NULL );
 	
 	/* if don't know last media file on object, return FALSE
 	 */
@@ -6627,7 +6628,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
 	dh_t objh;
 	dh_t fileh;
 
-	ASSERT( purp == PURP_DIR || purp == PURP_NONDIR );
+	assert( purp == PURP_DIR || purp == PURP_NONDIR );
 
 	pi_lock( );
 
@@ -6641,7 +6642,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
 	      ix++,
 	      strmh = DH2S( strmh )->s_nexth )
 		;
-	ASSERT( strmh != DH_NULL );
+	assert( strmh != DH_NULL );
 
 	/* get handle to indexed object
 	 */
@@ -6653,7 +6654,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
 	      ix++,
 	      objh = DH2O( objh )->o_nexth )
 		;
-	ASSERT( objh != DH_NULL );
+	assert( objh != DH_NULL );
 	
 	/* if don't know last media file on object, return FALSE
 	 */
@@ -6741,7 +6742,7 @@ addobj( bag_t *bagp,
 	bagobj_t *bagobjp;
 
 	bagobjp = ( bagobj_t * )calloc( 1, sizeof( bagobj_t ));
-	ASSERT( bagobjp );
+	assert( bagobjp );
 	uuid_copy(bagobjp->id, *idp);
 	strncpy( bagobjp->label,
 		 label,
@@ -6761,7 +6762,7 @@ cntobj( bag_t *bagp )
 	bagobj_t *bagobjp;
 	size_t cnt;
 
-	ASSERT( bagp );
+	assert( bagp );
 
 	bagiter_init( bagp, &bagiter );
 	cnt = 0;
@@ -6833,7 +6834,7 @@ askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
 	/* close the inventory
 	 */
 	ok = inv_close( invtok );
-	ASSERT( ok );
+	assert( ok );
 
 	/* return id of base session
 	 */
@@ -6933,7 +6934,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* query: ask if media changed or declined
@@ -6950,7 +6951,7 @@ retry:
 	}
 	querycnt = 0;
 	querystr[ querycnt++ ] = question;
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	dontix = choicecnt;
 	choicestr[ choicecnt++ ] = _("media change declined");
@@ -6965,7 +6966,7 @@ retry:
 	}
 	doix = choicecnt;
 	choicestr[ choicecnt++ ] = _("media changed");
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query( querystr,
@@ -6988,7 +6989,7 @@ retry:
 		ackstr[ ackcnt++ ] = _("media change aborted\n");
 	} else if ( responseix == invstatix ) {
 		ackstr[ ackcnt++ ] = "\n";
-		ASSERT( ackcnt <= ACKMAX );
+		assert( ackcnt <= ACKMAX );
 		dlog_multi_ack( ackstr,
 				ackcnt );
 		pi_show_nomloglock( );
@@ -6997,13 +6998,13 @@ retry:
 		postamblestr[ postamblecnt++ ] = "\n";
 		postamblestr[ postamblecnt++ ] = fold;
 		postamblestr[ postamblecnt++ ] = "\n\n";
-		ASSERT( postamblecnt <= POSTAMBLEMAX );
+		assert( postamblecnt <= POSTAMBLEMAX );
 		dlog_end( postamblestr,
 			  postamblecnt );
 		goto retry;
 	} else if ( responseix == neededix ) {
 		ackstr[ ackcnt++ ] = "\n";
-		ASSERT( ackcnt <= ACKMAX );
+		assert( ackcnt <= ACKMAX );
 		dlog_multi_ack( ackstr,
 				ackcnt );
 		display_needed_objects( purp,
@@ -7015,16 +7016,16 @@ retry:
 		postamblestr[ postamblecnt++ ] = "\n";
 		postamblestr[ postamblecnt++ ] = fold;
 		postamblestr[ postamblecnt++ ] = "\n\n";
-		ASSERT( postamblecnt <= POSTAMBLEMAX );
+		assert( postamblecnt <= POSTAMBLEMAX );
 		dlog_end( postamblestr,
 			  postamblecnt );
 		goto retry;
 	} else {
-		ASSERT( responseix == sigintix );
+		assert( responseix == sigintix );
 		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_multi_ack( ackstr,
 			ackcnt );
 
@@ -7033,7 +7034,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
@@ -7089,7 +7090,7 @@ retry:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* display vital stats and ask if this one should be restored
@@ -7105,7 +7106,7 @@ retry:
 			 "the following dump has been found"
 			 "\n\n") );
 	}
-	ASSERT( strlen( introstring ) < sizeof( introstring ));
+	assert( strlen( introstring ) < sizeof( introstring ));
 	display_dump_label( BOOL_FALSE,
 			    MLOG_NORMAL | MLOG_BARE,
 			    introstring,
@@ -7122,14 +7123,14 @@ retry:
 			_("\ninteractively restore from this dump?\n")
 				: _("\nrestore this dump?\n");
 	}
-	ASSERT( querycnt <= QUERYMAX );
+	assert( querycnt <= QUERYMAX );
 	choicecnt = 0;
 	dontix = choicecnt;
 	choicestr[ choicecnt++ ] = _("skip");
 	doix = choicecnt;
 	choicestr[ choicecnt++ ] = (persp->a.interpr) ?
 				_("interactively restore\n") : _("restore\n");
-	ASSERT( choicecnt <= CHOICEMAX );
+	assert( choicecnt <= CHOICEMAX );
 	sigintix = IXMAX - 1;
 
 	responseix = dlog_multi_query( querystr,
@@ -7153,11 +7154,11 @@ retry:
 	} else if ( responseix == dontix ) {
 		ackstr[ ackcnt++ ] = _("dump skipped\n");
 	} else {
-		ASSERT( responseix == sigintix );
+		assert( responseix == sigintix );
 		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
 	}
 
-	ASSERT( ackcnt <= ACKMAX );
+	assert( ackcnt <= ACKMAX );
 	dlog_multi_ack( ackstr,
 			ackcnt );
 
@@ -7166,7 +7167,7 @@ retry:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr,
 		  postamblecnt );
 
@@ -7329,8 +7330,8 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
 			return BOOL_FALSE;
 		}
 	} else if ( ! tranp->t_toconlypr ) {
-		ASSERT( path1 );
-		ASSERT( path2 );
+		assert( path1 );
+		assert( path2 );
 		mlog( MLOG_TRACE,
 		      "linking %s to %s\n",
 		      path1,
@@ -7523,7 +7524,7 @@ restore_reg( drive_t *drivep,
 		/* set the extended inode flags, except those which must
 		 * be set only after all data has been restored.
 		 */
-		ASSERT( bstatp->bs_extsize >= 0 );
+		assert( bstatp->bs_extsize >= 0 );
 		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
 		fsxattr.fsx_xflags = bstatp->bs_xflags & ~POST_DATA_XFLAGS;
 		fsxattr.fsx_extsize = (u_int32_t) bstatp->bs_extsize;
@@ -7604,7 +7605,7 @@ restore_extent_group( drive_t *drivep,
 		 */
 		if ( ehdr.eh_type == EXTENTHDR_TYPE_ALIGN ) {
 			size_t sz;
-			ASSERT( ehdr.eh_sz <= INTGENMAX );
+			assert( ehdr.eh_sz <= INTGENMAX );
 			sz = ( size_t )ehdr.eh_sz;
 			rv = discard_padding( sz, drivep );
 			if ( rv != RV_OK ) {
@@ -7628,7 +7629,7 @@ restore_extent_group( drive_t *drivep,
 
 		/* real data
 		 */
-		ASSERT( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
+		assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
 		bytesread = 0;
 		rv = restore_extent( fhdrp,
 				     &ehdr,
@@ -7971,7 +7972,7 @@ restore_symlink( drive_t *drivep,
 
 	/* symlinks always have one extent
 	 */
-	ASSERT( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
+	assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
 
 	/* read the link path extent
 	 */
@@ -8006,7 +8007,7 @@ restore_symlink( drive_t *drivep,
 		}
 		return BOOL_FALSE;
 	}
-	ASSERT( ( off64_t )nread == ehdr.eh_sz );
+	assert( ( off64_t )nread == ehdr.eh_sz );
 	if ( ! scratch ) {
 		if ( path ) {
 			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
@@ -8109,7 +8110,7 @@ read_filehdr( drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs )
 	default:
 		return RV_CORE;
 	}
-	ASSERT( ( size_t )nread == sizeof( *fhdrp ));
+	assert( ( size_t )nread == sizeof( *fhdrp ));
 
 	mlog( MLOG_NITTY,
 	      "read file hdr off %lld flags 0x%x ino %llu mode 0x%08x\n",
@@ -8168,7 +8169,7 @@ read_extenthdr( drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs )
 	default:
 		return RV_CORE;
 	}
-	ASSERT( ( size_t )nread == sizeof( *ehdrp ));
+	assert( ( size_t )nread == sizeof( *ehdrp ));
 
 	mlog( MLOG_NITTY,
 	      "read extent hdr size %lld offset %lld type %d flags %08x\n",
@@ -8208,8 +8209,8 @@ read_dirent( drive_t *drivep,
 	direnthdr_t tmpdh;
 	char *namep;    // beginning of name following the direnthdr_t
 
-	ASSERT( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
-	ASSERT( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
+	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
+	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
 
 	/* read the head of the dirent
 	 */
@@ -8236,7 +8237,7 @@ read_dirent( drive_t *drivep,
 	default:
 		return RV_CORE;
 	}
-	ASSERT( ( size_t )nread == DIRENTHDR_SZ );
+	assert( ( size_t )nread == DIRENTHDR_SZ );
 
 	if ( grhdrp->gh_version >= GLOBAL_HDR_VERSION_3 ) {
 		xlate_direnthdr(&tmpdh, dhdrp, 1);
@@ -8279,15 +8280,15 @@ read_dirent( drive_t *drivep,
 	/* if null, return
 	 */
 	if ( dhdrp->dh_ino == 0 ) {
-		ASSERT( ( size_t )dhdrp->dh_sz == sizeof( direnthdr_t ));
+		assert( ( size_t )dhdrp->dh_sz == sizeof( direnthdr_t ));
 		return RV_OK;
 	}
 
 	/* read the remainder of the dirent.
 	 */
-	ASSERT( ( size_t )dhdrp->dh_sz <= direntbufsz );
-	ASSERT( ( size_t )dhdrp->dh_sz >= sizeof( direnthdr_t ));
-	ASSERT( ! ( ( size_t )dhdrp->dh_sz & ( DIRENTHDR_ALIGN - 1 )));
+	assert( ( size_t )dhdrp->dh_sz <= direntbufsz );
+	assert( ( size_t )dhdrp->dh_sz >= sizeof( direnthdr_t ));
+	assert( ! ( ( size_t )dhdrp->dh_sz & ( DIRENTHDR_ALIGN - 1 )));
 	if ( ( size_t )dhdrp->dh_sz > sizeof( direnthdr_t )) {
 		size_t remsz = ( size_t )dhdrp->dh_sz - sizeof( direnthdr_t );
 		nread = read_buf( namep,
@@ -8313,7 +8314,7 @@ read_dirent( drive_t *drivep,
 		default:
 			return RV_CORE;
 		}
-		ASSERT( ( size_t ) nread == remsz );
+		assert( ( size_t ) nread == remsz );
 	}
 
 	return RV_OK;
@@ -8353,7 +8354,7 @@ read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
 	default:
 		return RV_CORE;
 	}
-	ASSERT( ( size_t )nread == sizeof( *ahdrp ));
+	assert( ( size_t )nread == sizeof( *ahdrp ));
 
 	mlog( MLOG_NITTY,
 	      "read extattr hdr sz %u valoff %u flags 0x%x valsz %u cs 0x%x\n",
@@ -8408,7 +8409,7 @@ discard_padding( size_t sz, drive_t *drivep )
 			  &rval );
 	switch( rval ) {
 	case 0:
-		ASSERT( ( size_t )nread == sz );
+		assert( ( size_t )nread == sz );
 		return RV_OK;
 	case DRIVE_ERROR_EOF:
 	case DRIVE_ERROR_EOD:
@@ -8444,11 +8445,11 @@ restore_extent( filehdr_t *fhdrp,
 	*bytesreadp = 0;
 
 	if ( fd != -1 ) {
-		ASSERT( path );
+		assert( path );
 		/* seek to the beginning of the extent.
 		 * must be on a basic fs blksz boundary.
 		 */
-		ASSERT( ( off & ( off64_t )( BBSIZE - 1 )) == 0 );
+		assert( ( off & ( off64_t )( BBSIZE - 1 )) == 0 );
 		new_off = lseek64(  fd, off, SEEK_SET );
 		if ( new_off < 0 ) {
 			mlog( MLOG_NORMAL | MLOG_WARNING, _(
@@ -8462,7 +8463,7 @@ restore_extent( filehdr_t *fhdrp,
 			fd = -1;
 			new_off = off;
 		}
-		ASSERT( new_off == off );
+		assert( new_off == off );
 	}
 	if ( (fd != -1) && (bstatp->bs_xflags & XFS_XFLAG_REALTIME) ) {
 		if ( (ioctl(fd, XFS_IOC_DIOINFO, &da) < 0) ) {
@@ -8530,14 +8531,14 @@ restore_extent( filehdr_t *fhdrp,
 			return rv;
 		}
 		if ( off >= bstatp->bs_size ) {
-			ASSERT( off == bstatp->bs_size );
+			assert( off == bstatp->bs_size );
 			ntowrite = 0;
 		} else if ((off64_t)sup_bufsz > bstatp->bs_size - off ) {
 			ntowrite = ( size_t )( bstatp->bs_size - off );
 		} else {
 			ntowrite = sup_bufsz;
 		}
-		ASSERT( ntowrite <= ( size_t )INTGENMAX );
+		assert( ntowrite <= ( size_t )INTGENMAX );
 		if ( ntowrite > 0 ) {
 			*bytesreadp += ( off64_t )ntowrite;
 			if ( fd != -1 ) {
@@ -8562,7 +8563,7 @@ restore_extent( filehdr_t *fhdrp,
 				      tmp_off += ( off64_t )rval ) {
 					int rttrunc = 0;
 					int trycnt = 0;
-					ASSERT( remaining
+					assert( remaining
 						<=
 						( size_t )INTGENMAX );
 					/*
@@ -8608,7 +8609,7 @@ restore_extent( filehdr_t *fhdrp,
 						nwritten = rval;
 						break;
 					}
-					ASSERT( ( size_t )rval <= remaining );
+					assert( ( size_t )rval <= remaining );
 					if ( rval < remaining ) {
 						mlog( MLOG_NORMAL | MLOG_WARNING,
 						      _("attempt to "
@@ -8644,7 +8645,7 @@ restore_extent( filehdr_t *fhdrp,
 				      off,
 				      strerror( errno ));
 			} else {
-				ASSERT( ( size_t )nwritten < ntowrite );
+				assert( ( size_t )nwritten < ntowrite );
 				mlog( MLOG_NORMAL, _(
 				      "attempt to write %u bytes to %s at "
 				      "offset %lld failed: only %d bytes "
@@ -8657,7 +8658,7 @@ restore_extent( filehdr_t *fhdrp,
 			/* stop attempting to write, but complete reads
 			 */
 			fd = -1;
-			ASSERT( ntowrite <= ( size_t )INTGENMAX );
+			assert( ntowrite <= ( size_t )INTGENMAX );
 			nwritten = ( intgen_t )ntowrite;
 		}
 		sz -= ( off64_t )sup_bufsz;
@@ -8673,7 +8674,7 @@ static size_t extattrbufsz = 0; /* size of each extattr buffer */
 static bool_t
 extattr_init( size_t drivecnt )
 {
-	ASSERT( ! extattrbufp );
+	assert( ! extattrbufp );
 	extattrbufsz = EXTATTRHDR_SZ		/* dump hdr */
 		       +
 		       NAME_MAX			/* attribute name */
@@ -8721,7 +8722,7 @@ restore_extattr( drive_t *drivep,
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	bool_t isfilerestored = BOOL_FALSE;
 
-	ASSERT( extattrbufp );
+	assert( extattrbufp );
 
 	if ( ! isdirpr )
 		isfilerestored = partial_check(bstatp->bs_ino,  bstatp->bs_size);
@@ -8745,8 +8746,8 @@ restore_extattr( drive_t *drivep,
 		}
 
 		recsz = ( size_t )ahdrp->ah_sz;
-		ASSERT( recsz <= extattrbufsz );
-		ASSERT( recsz >= EXTATTRHDR_SZ );
+		assert( recsz <= extattrbufsz );
+		assert( recsz >= EXTATTRHDR_SZ );
 		nread = read_buf( ( char * )&ahdrp[ 1 ],
 				  recsz - EXTATTRHDR_SZ,
 				  ( void * )drivep,
@@ -8769,7 +8770,7 @@ restore_extattr( drive_t *drivep,
 		default:
 			return RV_CORE;
 		}
-		ASSERT( nread == ( intgen_t )( recsz - EXTATTRHDR_SZ ));
+		assert( nread == ( intgen_t )( recsz - EXTATTRHDR_SZ ));
 
 		if ( ! persp->a.restoreextattrpr && ! persp->a.restoredmpr ) {
 			continue;
@@ -8784,7 +8785,7 @@ restore_extattr( drive_t *drivep,
 		 * extended attributes.
 		 */
 		if ( isdirpr ) {
-			ASSERT( ! path );
+			assert( ! path );
 			if ( dah != DAH_NULL ) {
 				dirattr_addextattr( dah, ahdrp );
 			}
@@ -9297,7 +9298,7 @@ pi_show( char *introstring )
 	strbuflen = sprintf( strbuf,
 			     "persistent inventory media file tree%s",
 			     introstring );
-	ASSERT( ( size_t )strbuflen < sizeof( strbuf ));
+	assert( ( size_t )strbuflen < sizeof( strbuf ));
 	fold_init( fold, strbuf, ':' );
 	mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
 	      "\n%s\n\n",
@@ -9528,8 +9529,8 @@ display_dump_label( bool_t lockpr,
 	char media_string_uuid[UUID_STR_LEN + 1];
 	char fs_string_uuid[UUID_STR_LEN + 1];
 
-	ASSERT( scrhdrp->cih_level >= 0 );
-	ASSERT( scrhdrp->cih_level < 10 );
+	assert( scrhdrp->cih_level >= 0 );
+	assert( scrhdrp->cih_level < 10 );
 	level_string[ 0 ] = ( char )( '0' + ( u_char_t )scrhdrp->cih_level );
 	level_string[ 1 ] = 0;
 
diff --git a/restore/dirattr.c b/restore/dirattr.c
index fcfa0c8..c829808 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -36,6 +36,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <dirent.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -201,14 +202,14 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( dirattr_pers_t ) <= DIRATTR_PERS_SZ );
-	ASSERT( ! dtp );
-	ASSERT( ! dpp );
+	assert( sizeof( dirattr_pers_t ) <= DIRATTR_PERS_SZ );
+	assert( ! dtp );
+	assert( ! dpp );
 
 	/* allocate and initialize context
 	 */
 	dtp = ( dirattr_tran_t * )calloc( 1, sizeof( dirattr_tran_t ));
-	ASSERT( dtp );
+	assert( dtp );
 	dtp->dt_cachedh = DAH_NULL;
 	dtp->dt_fd = -1;
 	dtp->dt_extattrfd = -1;
@@ -308,11 +309,11 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
 
 	/* mmap the persistent descriptor
 	 */
-	ASSERT( ! ( DIRATTR_PERS_SZ % pgsz ));
+	assert( ! ( DIRATTR_PERS_SZ % pgsz ));
 	dpp = ( dirattr_pers_t * )mmap_autogrow( DIRATTR_PERS_SZ,
 				        dtp->dt_fd,
 				        ( off_t )0 );
-	ASSERT( dpp );
+	assert( dpp );
 	if ( dpp == ( dirattr_pers_t * )-1 ) {
 		mlog( MLOG_NORMAL | MLOG_ERROR, _(
 		      "unable to map %s: %s\n"),
@@ -355,7 +356,7 @@ dirattr_cleanup( void )
 	}
 	if ( dpp ) {
 		rval = munmap( ( void * )dpp, DIRATTR_PERS_SZ );
-		ASSERT( ! rval );
+		assert( ! rval );
 		dpp = 0;
 	}
 	if ( dtp->dt_fd >= 0 ) {
@@ -392,8 +393,8 @@ dirattr_add( filehdr_t *fhdrp )
 	
 	/* sanity checks
 	 */
-	ASSERT( dtp );
-	ASSERT( dpp );
+	assert( dtp );
+	assert( dpp );
 
 	/* make sure file pointer is positioned to write at end of file
 	 */
@@ -406,7 +407,7 @@ dirattr_add( filehdr_t *fhdrp )
 			      strerror( errno ));
 			return DAH_NULL;
 		}
-		ASSERT( dpp->dp_appendoff == newoff );
+		assert( dpp->dp_appendoff == newoff );
 		dtp->dt_at_endpr = BOOL_TRUE;
 	}
 
@@ -420,7 +421,7 @@ dirattr_add( filehdr_t *fhdrp )
 	 */
 	oldoff = dpp->dp_appendoff;
 	dix = OFF2DIX( oldoff );
-	ASSERT( dix <= DIX_MAX );
+	assert( dix <= DIX_MAX );
 
 	/* populate a dirattr
 	 */
@@ -449,7 +450,7 @@ dirattr_add( filehdr_t *fhdrp )
 
 	/* update the next write offset
 	 */
-	ASSERT( dpp->dp_appendoff <= OFF64MAX - ( off64_t )sizeof(dirattr_t) );
+	assert( dpp->dp_appendoff <= OFF64MAX - ( off64_t )sizeof(dirattr_t) );
 	dpp->dp_appendoff += ( off64_t )sizeof(dirattr_t);
 
 #ifdef DIRATTRCHK
@@ -514,7 +515,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
-		ASSERT( seekoff == off );
+		assert( seekoff == off );
 
 		oldoff = off;
 
@@ -595,7 +596,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return;
 		}
-		ASSERT( seekoff == oldoff );
+		assert( seekoff == oldoff );
 		nwritten = write( dtp->dt_extattrfd,
 				  ( void * )&off,
 				  sizeof( off ));
@@ -672,7 +673,7 @@ dirattr_cb_extattr( dah_t dah,
 			dtp->dt_extattrfdbadpr = BOOL_TRUE;
 			return BOOL_TRUE;
 		}
-		ASSERT( seekoff == off );
+		assert( seekoff == off );
 
 		/* peel off the next offset
 		 */
@@ -711,7 +712,7 @@ dirattr_cb_extattr( dah_t dah,
 		/* read the remainder of the extattr
 		 */
 		recsz = ( size_t )ahdrp->ah_sz;
-		ASSERT( recsz >= EXTATTRHDR_SZ );
+		assert( recsz >= EXTATTRHDR_SZ );
 		nread = read( dtp->dt_extattrfd,
 			      ( void * )&ahdrp[ 1 ],
 			      recsz - EXTATTRHDR_SZ );
@@ -756,10 +757,10 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 
 	/* sanity checks
 	 */
-	ASSERT( dtp );
-	ASSERT( dpp );
+	assert( dtp );
+	assert( dpp );
 
-	ASSERT( dah != DAH_NULL );
+	assert( dah != DAH_NULL );
 
 #ifdef DIRATTRCHK
 	sum = HDLGETSUM( dah );
@@ -768,18 +769,18 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 	dix = ( dix_t )dah;
 #endif /* DIRATTRCHK */
 
-	ASSERT( dix >= 0 );
-	ASSERT( dix <= DIX_MAX );
+	assert( dix >= 0 );
+	assert( dix <= DIX_MAX );
 
 	argoff = DIX2OFF( dix );
-	ASSERT( argoff >= 0 );
-	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	assert( argoff >= 0 );
+	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
+	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
 
 #ifdef DIRATTRCHK
 	dirattr_get( dah );
-	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
+	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
+	assert( dtp->dt_cached_dirattr.d_sum == sum );
 #endif /* DIRATTRCHK */
 
 	if ( dtp->dt_at_endpr && dtp->dt_off ) {
@@ -796,9 +797,9 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 		mlog( MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
-	ASSERT( newoff == argoff );
+	assert( newoff == argoff );
 
 	/* populate a dirattr
 	 */
@@ -822,7 +823,7 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 		mlog( MLOG_NORMAL, _(
 		      "update of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -959,10 +960,10 @@ dirattr_get( dah_t dah )
 
 	/* sanity checks
 	 */
-	ASSERT( dtp );
-	ASSERT( dpp );
+	assert( dtp );
+	assert( dpp );
 
-	ASSERT( dah != DAH_NULL );
+	assert( dah != DAH_NULL );
 
 	/* if we are already holding this dirattr in cache,
 	 * just return
@@ -977,13 +978,13 @@ dirattr_get( dah_t dah )
 #else /* DIRATTRCHK */
 	dix = ( dix_t )dah;
 #endif /* DIRATTRCHK */
-	ASSERT( dix >= 0 );
-	ASSERT( dix <= DIX_MAX );
+	assert( dix >= 0 );
+	assert( dix <= DIX_MAX );
 
 	argoff = DIX2OFF( dix );
-	ASSERT( argoff >= 0 );
-	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	assert( argoff >= 0 );
+	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
+	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
 
 	if ( dtp->dt_at_endpr && dtp->dt_off ) {
 		if (dirattr_flush() != RV_OK) {
@@ -999,9 +1000,9 @@ dirattr_get( dah_t dah )
 		mlog( MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
-	ASSERT( newoff == argoff );
+	assert( newoff == argoff );
 
 	/* read the dirattr
 	 */
@@ -1012,12 +1013,12 @@ dirattr_get( dah_t dah )
 		mlog( MLOG_NORMAL, _(
 		      "read of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
 
 #ifdef DIRATTRCHK
-	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
+	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
+	assert( dtp->dt_cached_dirattr.d_sum == sum );
 #endif /* DIRATTRCHK */
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -1038,13 +1039,13 @@ dirattr_cacheflush( void )
 
 	/* sanity checks
 	 */
-	ASSERT( dtp );
-	ASSERT( dpp );
+	assert( dtp );
+	assert( dpp );
 
 	/* if nothing in the cache, ignore
 	 */
 	dah = dtp->dt_cachedh;
-	ASSERT( dah != DAH_NULL );
+	assert( dah != DAH_NULL );
 	if ( dah == DAH_NULL ) {
 		return;
 	}
@@ -1057,17 +1058,17 @@ dirattr_cacheflush( void )
 #endif /* DIRATTRCHK */
 
 #ifdef DIRATTRCHK
-	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
-	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
+	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
+	assert( dtp->dt_cached_dirattr.d_sum == sum );
 #endif /* DIRATTRCHK */
 
-	ASSERT( dix >= 0 );
-	ASSERT( dix <= DIX_MAX );
+	assert( dix >= 0 );
+	assert( dix <= DIX_MAX );
 
 	argoff = DIX2OFF( dix );
-	ASSERT( argoff >= 0 );
-	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
-	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
+	assert( argoff >= 0 );
+	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
+	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
 
 	/* seek to the dirattr
 	 */
@@ -1076,9 +1077,9 @@ dirattr_cacheflush( void )
 		mlog( MLOG_NORMAL, _(
 		      "lseek of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
-	ASSERT( newoff == argoff );
+	assert( newoff == argoff );
 
 	/* write the dirattr
 	 */
@@ -1089,7 +1090,7 @@ dirattr_cacheflush( void )
 		mlog( MLOG_NORMAL, _(
 		      "flush of dirattr failed: %s\n"),
 		      strerror( errno ));
-		ASSERT( 0 );
+		assert( 0 );
 	}
 
 	dtp->dt_at_endpr = BOOL_FALSE;
@@ -1104,7 +1105,7 @@ calcdixcum( dix_t dix )
 	ix_t nibcnt;
 	ix_t nibix;
 
-	ASSERT( ( sizeof( dah_t ) / HDLSUMCNT ) * HDLSUMCNT == sizeof( dah_t ));
+	assert( ( sizeof( dah_t ) / HDLSUMCNT ) * HDLSUMCNT == sizeof( dah_t ));
 
 	nibcnt = ( sizeof( dah_t ) / HDLSUMCNT ) - 1;
 	sum = 0;
diff --git a/restore/inomap.c b/restore/inomap.c
index 562492e..2c62afc 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -26,6 +26,7 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <time.h>
+#include <assert.h>
 
 #include "types.h"
 #include "util.h"
@@ -195,9 +196,9 @@ inomap_restore_pers( drive_t *drivep,
 
 	/* sanity checks
 	 */
-	ASSERT( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
-	ASSERT( sizeof( hnk_t ) == HNKSZ );
-	ASSERT( sizeof( pers_t ) <= PERSSZ );
+	assert( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
+	assert( sizeof( hnk_t ) == HNKSZ );
+	assert( sizeof( pers_t ) <= PERSSZ );
 
 	/* get inomap info from media hdr
 	 */
@@ -243,7 +244,7 @@ inomap_restore_pers( drive_t *drivep,
 	persp->last_ino_added = last_ino_added;
 
 	tmphnkp = ( hnk_t * )calloc( ( size_t )hnkcnt, sizeof( hnk_t ));
-	ASSERT( tmphnkp );
+	assert( tmphnkp );
 
 	/* read the map in from media
 	 */
@@ -268,7 +269,7 @@ inomap_restore_pers( drive_t *drivep,
 		        PERSSZ
 		        +
 		        sizeof( hnk_t ) * ( size_t )hnkcnt );
-	ASSERT( ! rval1 );
+	assert( ! rval1 );
 	( void )close( fd );
 	free( ( void * )perspath );
 
@@ -278,7 +279,7 @@ inomap_restore_pers( drive_t *drivep,
 	 */
 	switch( rval ) {
 	case 0:
-		ASSERT( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
+		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
 		ok = inomap_sync_pers( hkdir );
 		if ( ! ok ) {
 			return RV_ERROR;
@@ -325,7 +326,7 @@ inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp )
 	 */
 	switch( rval ) {
 	case 0:
-		ASSERT( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
+		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
 		return RV_OK;
 	case DRIVE_ERROR_EOD:
 	case DRIVE_ERROR_EOF:
@@ -350,7 +351,7 @@ inomap_sync_pers( char *hkdir )
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( hnk_t ) == HNKSZ );
+	assert( sizeof( hnk_t ) == HNKSZ );
 
 	/* only needed once per session
 	 */
@@ -388,7 +389,7 @@ inomap_sync_pers( char *hkdir )
 
 	/* mmap the pers inomap
 	 */
-	ASSERT( hnkcnt * sizeof( hnk_t ) <= ( size64_t )INT32MAX );
+	assert( hnkcnt * sizeof( hnk_t ) <= ( size64_t )INT32MAX );
 	roothnkp = ( hnk_t * ) mmap_autogrow(
 				       sizeof( hnk_t ) * ( size_t )hnkcnt,
 				       pers_fd,
@@ -415,7 +416,7 @@ inomap_sync_pers( char *hkdir )
 	/* calculate the tail pointers
 	 */
 	tailhnkp = hnkp;
-	ASSERT( hnkcnt > 0 );
+	assert( hnkcnt > 0 );
 	lastsegp = &tailhnkp->seg[ ( intgen_t )( segcnt
 						 -
 						 SEGPERHNK * ( hnkcnt - 1 )
@@ -485,7 +486,7 @@ inomap_sanitize( void )
 void
 inomap_rst_add( xfs_ino_t ino )
 {
-		ASSERT( pers_fd >= 0 );
+		assert( pers_fd >= 0 );
 		( void )map_set( ino, MAP_NDR_CHANGE );
 }
 
@@ -494,7 +495,7 @@ inomap_rst_add( xfs_ino_t ino )
 void
 inomap_rst_del( xfs_ino_t ino )
 {
-		ASSERT( pers_fd >= 0 );
+		assert( pers_fd >= 0 );
 		( void )map_set( ino, MAP_NDR_NOREST );
 }
 
diff --git a/restore/namreg.c b/restore/namreg.c
index 41362d1..c64833d 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -24,6 +24,7 @@
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <assert.h>
 
 #include "types.h"
 #include "lock.h"
@@ -118,15 +119,15 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
 
 	/* sanity checks
 	 */
-	ASSERT( ! ntp );
-	ASSERT( ! npp );
+	assert( ! ntp );
+	assert( ! npp );
 
-	ASSERT( sizeof( namreg_pers_t ) <= NAMREG_PERS_SZ );
+	assert( sizeof( namreg_pers_t ) <= NAMREG_PERS_SZ );
 
 	/* allocate and initialize context
 	 */
 	ntp = ( namreg_tran_t * )calloc( 1, sizeof( namreg_tran_t ));
-	ASSERT( ntp );
+	assert( ntp );
 
 	/* generate a string containing the pathname of the namreg file
 	 */
@@ -223,7 +224,7 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
 
 	/* mmap the persistent descriptor
 	 */
-	ASSERT( ! ( NAMREG_PERS_SZ % pgsz ));
+	assert( ! ( NAMREG_PERS_SZ % pgsz ));
 	npp = ( namreg_pers_t * ) mmap_autogrow(
 				        NAMREG_PERS_SZ,
 				        ntp->nt_fd,
@@ -258,9 +259,9 @@ namreg_add( char *name, size_t namelen )
 	
 	/* sanity checks
 	 */
-	ASSERT( ntp );
-	ASSERT( npp );
-	ASSERT( !ntp->nt_map );
+	assert( ntp );
+	assert( npp );
+	assert( !ntp->nt_map );
 
 	/* make sure file pointer is positioned to append
 	 */
@@ -271,10 +272,10 @@ namreg_add( char *name, size_t namelen )
 			mlog( MLOG_NORMAL, _(
 			      "lseek of namreg failed: %s\n"),
 			      strerror( errno ));
-			ASSERT( 0 );
+			assert( 0 );
 			return NRH_NULL;
 		}
-		ASSERT( npp->np_appendoff == newoff );
+		assert( npp->np_appendoff == newoff );
 		ntp->nt_at_endpr = BOOL_TRUE;
 	}
 
@@ -290,7 +291,7 @@ namreg_add( char *name, size_t namelen )
 
 	/* write a one byte unsigned string length into the buffer.
 	 */
-	ASSERT( namelen < 256 );
+	assert( namelen < 256 );
 	c = ( unsigned char )( namelen & 0xff );
 	ntp->nt_buf[ntp->nt_off++] = c;
 
@@ -300,7 +301,7 @@ namreg_add( char *name, size_t namelen )
 	ntp->nt_off += namelen;
 
 	npp->np_appendoff += ( off64_t )( 1 + namelen );
-	ASSERT( oldoff <= HDLMAX );
+	assert( oldoff <= HDLMAX );
 
 #ifdef NAMREGCHK
 
@@ -375,12 +376,12 @@ namreg_get( nrh_t nrh,
 
 	/* sanity checks
 	 */
-	ASSERT( ntp );
-	ASSERT( npp );
+	assert( ntp );
+	assert( npp );
 
 	/* make sure we aren't being given a NULL handle
 	 */
-	ASSERT( nrh != NRH_NULL );
+	assert( nrh != NRH_NULL );
 
 	/* convert the handle into the offset
 	 */
@@ -397,9 +398,9 @@ namreg_get( nrh_t nrh,
 
 	/* do sanity check on offset
 	 */
-	ASSERT( newoff <= HDLMAX );
-	ASSERT( newoff < npp->np_appendoff );
-	ASSERT( newoff >= ( off64_t )NAMREG_PERS_SZ );
+	assert( newoff <= HDLMAX );
+	assert( newoff < npp->np_appendoff );
+	assert( newoff >= ( off64_t )NAMREG_PERS_SZ );
 
 	lock( );
 
@@ -461,7 +462,7 @@ namreg_get( nrh_t nrh,
 
 	/* validate the checkbit
 	 */
-	ASSERT( chkbit
+	assert( chkbit
 		==
 		( ( ( nrh_t )len + ( nrh_t )bufp[ 0 ] ) & CHKBITLOMASK ));
 
diff --git a/restore/node.c b/restore/node.c
index 4cc8fb0..f0297a5 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <memory.h>
 #include <limits.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -188,9 +189,9 @@ node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	ASSERT( pp );
-	ASSERT( *pp );
-	ASSERT( nh != NH_NULL );
+	assert( pp );
+	assert( *pp );
+	assert( nh != NH_NULL );
 
 	/* convert the handle into an index
 	 */
@@ -199,19 +200,19 @@ node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
 	nh = HDLGETNHDL( nh );
 #endif /* NODECHK */
 
-	ASSERT( nh <= NH_MAX );
+	assert( nh <= NH_MAX );
 
 #ifdef NODECHK
 	hkp = *( *( u_char_t ** )pp + node_hdrp->nh_nodehkix );
 	nodegen = HKPGETGEN( hkp );
-	ASSERT( nodegen == hdlgen );
+	assert( nodegen == hdlgen );
 	nodeunq = HKPGETUNQ( hkp );
 	if ( ! freepr ) {
-		ASSERT( nodeunq != NODEUNQFREE );
-		ASSERT( nodeunq == NODEUNQALCD );
+		assert( nodeunq != NODEUNQFREE );
+		assert( nodeunq == NODEUNQALCD );
 	} else {
-		ASSERT( nodeunq != NODEUNQALCD );
-		ASSERT( nodeunq == NODEUNQFREE );
+		assert( nodeunq != NODEUNQALCD );
+		assert( nodeunq == NODEUNQFREE );
 	}
 #endif /* NODECHK */
 
@@ -240,16 +241,16 @@ node_init( intgen_t fd,
 
 	/* sanity checks
 	 */
-	ASSERT( sizeof( node_hdr_t ) <= NODE_HDRSZ );
-	ASSERT( sizeof( nh_t ) < sizeof( off64_t ));
-	ASSERT( sizeof( nh_t ) <= sizeof( segix_t ));
-	ASSERT( sizeof( nh_t ) <= sizeof( relnix_t ));
-	ASSERT( nodehkix < usrnodesz );
-	ASSERT( usrnodesz >= sizeof( char * ) + 1 );
+	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
+	assert( sizeof( nh_t ) < sizeof( off64_t ));
+	assert( sizeof( nh_t ) <= sizeof( segix_t ));
+	assert( sizeof( nh_t ) <= sizeof( relnix_t ));
+	assert( nodehkix < usrnodesz );
+	assert( usrnodesz >= sizeof( char * ) + 1 );
 		/* so node is at least big enough to hold
 		 * the free list linkage and the housekeeping byte
 		 */
-	ASSERT( nodehkix > sizeof( char * ));
+	assert( nodehkix > sizeof( char * ));
 		/* since beginning of each node is used to
 		 * link it in the free list.
 		 */
@@ -283,7 +284,7 @@ node_init( intgen_t fd,
 	 * reasonable cap on the max number of segments.
 	 */
 
-	ASSERT( NODESPERSEG_MIN >= pgsz );
+	assert( NODESPERSEG_MIN >= pgsz );
 
 	if ( vmsz < WINMAP_MIN * NODESPERSEG_MIN * nodesz ) {
 		mlog( MLOG_NORMAL | MLOG_ERROR, _(
@@ -331,10 +332,10 @@ node_init( intgen_t fd,
 
 	/* map the abstraction header
 	 */
-	ASSERT( ( NODE_HDRSZ & pgmask ) == 0 );
-	ASSERT( ! ( NODE_HDRSZ % pgsz ));
-	ASSERT( off <= OFF64MAX );
-	ASSERT( ! ( off % ( off64_t )pgsz ));
+	assert( ( NODE_HDRSZ & pgmask ) == 0 );
+	assert( ! ( NODE_HDRSZ % pgsz ));
+	assert( off <= OFF64MAX );
+	assert( ! ( off % ( off64_t )pgsz ));
 	node_hdrp = ( node_hdr_t * )mmap_autogrow(
 					    NODE_HDRSZ,
 					    fd,
@@ -394,13 +395,13 @@ node_sync( intgen_t fd, off64_t off )
 {
 	/* sanity checks
 	 */
-	ASSERT( sizeof( node_hdr_t ) <= NODE_HDRSZ );
+	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
 
 	/* map the abstraction header
 	 */
-	ASSERT( ( NODE_HDRSZ & pgmask ) == 0 );
-	ASSERT( off <= ( off64_t )OFF64MAX );
-	ASSERT( ! ( off % ( off64_t )pgsz ));
+	assert( ( NODE_HDRSZ & pgmask ) == 0 );
+	assert( off <= ( off64_t )OFF64MAX );
+	assert( ! ( off % ( off64_t )pgsz ));
 	node_hdrp = ( node_hdr_t * )mmap_autogrow(
 					    NODE_HDRSZ,
 					    fd,
@@ -454,8 +455,8 @@ node_alloc( void )
 		hkpp = p + node_hdrp->nh_nodehkix;
 		gen = ( u_char_t )( HKPGETGEN( *p ) + ( u_char_t )1 );
 		unq = HKPGETUNQ( *hkpp );
-		ASSERT( unq != NODEUNQALCD );
-		ASSERT( unq == NODEUNQFREE );
+		assert( unq != NODEUNQALCD );
+		assert( unq == NODEUNQFREE );
 #endif /* NODECHK */
 
 		/* adjust the free list */
@@ -473,7 +474,7 @@ node_alloc( void )
 				( off64_t )nh2segix( node_hdrp->nh_virgnh ) *
 				( off64_t )node_hdrp->nh_segsz;
 
-			ASSERT( new_seg_off
+			assert( new_seg_off
 				<=
 				OFF64MAX - ( off64_t )node_hdrp->nh_segsz );
 			mlog( MLOG_DEBUG,
@@ -531,7 +532,7 @@ node_map( nh_t nh )
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	ASSERT( nh != NH_NULL );
+	assert( nh != NH_NULL );
 
 	/* convert the handle into an index
 	 */
@@ -540,7 +541,7 @@ node_map( nh_t nh )
 	nh = HDLGETNHDL( nh );
 #endif /* NODECHK */
 
-	ASSERT( nh <= NH_MAX );
+	assert( nh <= NH_MAX );
 
 	/* map in
 	 */
@@ -553,9 +554,9 @@ node_map( nh_t nh )
 	hkp = *( p + node_hdrp->nh_nodehkix );
 	nodegen = HKPGETGEN( hkp );
 	nodeunq = HKPGETUNQ( hkp );
-	ASSERT( nodegen == hdlgen );
-	ASSERT( nodeunq != NODEUNQFREE );
-	ASSERT( nodeunq == NODEUNQALCD );
+	assert( nodegen == hdlgen );
+	assert( nodeunq != NODEUNQFREE );
+	assert( nodeunq == NODEUNQALCD );
 #endif /* NODECHK */
 
 	return ( void * )p;
@@ -580,9 +581,9 @@ node_free( nh_t *nhp )
 	register u_char_t nodeunq;
 #endif /* NODECHK */
 
-	ASSERT( nhp );
+	assert( nhp );
 	nh = *nhp;
-	ASSERT( nh != NH_NULL );
+	assert( nh != NH_NULL );
 
 	/* convert the handle into an index
 	 */
@@ -591,7 +592,7 @@ node_free( nh_t *nhp )
 	nh = HDLGETNHDL( nh );
 #endif /* NODECHK */
 
-	ASSERT( nh <= NH_MAX );
+	assert( nh <= NH_MAX );
 
 	/* map in
 	 */
@@ -607,9 +608,9 @@ node_free( nh_t *nhp )
 	hkpp = p + node_hdrp->nh_nodehkix;
 	nodegen = HKPGETGEN( *hkpp );
 	nodeunq = HKPGETUNQ( *hkpp );
-	ASSERT( nodegen == hdlgen );
-	ASSERT( nodeunq != NODEUNQFREE );
-	ASSERT( nodeunq == NODEUNQALCD );
+	assert( nodegen == hdlgen );
+	assert( nodeunq != NODEUNQFREE );
+	assert( nodeunq == NODEUNQALCD );
 	*hkpp = HKPMKHKP( nodegen, NODEUNQFREE );
 #endif /* NODECHK */
 
diff --git a/restore/tree.c b/restore/tree.c
index 08e177f..d377590 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -28,6 +28,7 @@
 #include <xfs/handle.h>
 #include <dirent.h>
 #include <sys/ioctl.h>
+#include <assert.h>
 
 #include "types.h"
 #include "exit.h"
@@ -351,16 +352,16 @@ tree_init( char *hkdir,
 
 	/* sanity checks
 	 */
-	ASSERT( ! ( PERSSZ % pgsz ));
-	ASSERT( sizeof( persp ) <= PERSSZ );
-	ASSERT( sizeof( node_t ) <= NODESZ );
-	ASSERT( ! persp );
-	ASSERT( ! tranp );
+	assert( ! ( PERSSZ % pgsz ));
+	assert( sizeof( persp ) <= PERSSZ );
+	assert( sizeof( node_t ) <= NODESZ );
+	assert( ! persp );
+	assert( ! tranp );
 
 	/* allocate transient state
 	 */
 	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	ASSERT( tranp );
+	assert( tranp );
 
 	tranp->t_toconlypr = toconlypr;
 	tranp->t_hkdir = hkdir;
@@ -425,7 +426,7 @@ tree_init( char *hkdir,
 
 	/* mmap the persistent state
 	 */
-	ASSERT( ! ( PERSSZ % pgsz ));
+	assert( ! ( PERSSZ % pgsz ));
 	persp = ( treepers_t * ) mmap_autogrow(
 				     PERSSZ,
 				     tranp->t_persfd,
@@ -450,9 +451,9 @@ tree_init( char *hkdir,
 	 * begin immediately after the hash abstraction. give it the remainder
 	 * of vm.
 	 */
-	ASSERT( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
+	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
 	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
-	ASSERT( vmsz > ( size64_t )nodeoff );
+	assert( vmsz > ( size64_t )nodeoff );
 	ok = node_init( tranp->t_persfd, 
 		        nodeoff,
 		        NODESZ,
@@ -539,16 +540,16 @@ tree_sync( char *hkdir,
 
 	/* sanity checks
 	 */
-	ASSERT( ! ( PERSSZ % pgsz ));
-	ASSERT( sizeof( persp ) <= PERSSZ );
-	ASSERT( sizeof( node_t ) <= NODESZ );
-	ASSERT( ! persp );
-	ASSERT( ! tranp );
+	assert( ! ( PERSSZ % pgsz ));
+	assert( sizeof( persp ) <= PERSSZ );
+	assert( sizeof( node_t ) <= NODESZ );
+	assert( ! persp );
+	assert( ! tranp );
 
 	/* allocate transient state
 	 */
 	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	ASSERT( tranp );
+	assert( tranp );
 
 	tranp->t_toconlypr = toconlypr;
 	tranp->t_hkdir = hkdir;
@@ -600,7 +601,7 @@ tree_sync( char *hkdir,
 
 	/* mmap the persistent state
 	 */
-	ASSERT( ! ( PERSSZ % pgsz ));
+	assert( ! ( PERSSZ % pgsz ));
 	persp = ( treepers_t * ) mmap_autogrow(
 				     PERSSZ,
 				     tranp->t_persfd,
@@ -637,7 +638,7 @@ tree_sync( char *hkdir,
 
 	/* synchronize with the node abstraction.
 	 */
-	ASSERT( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
+	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
 	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
 	ok = node_sync( tranp->t_persfd, nodeoff );
 	if ( ! ok ) {
@@ -687,7 +688,7 @@ tree_marknoref( void )
 		node_t *orphp;
 		orphp = Node_map( persp->p_orphh );
 		orphp->n_flags |= ( NF_REFED | NF_DUMPEDDIR );
-		ASSERT( orphp->n_dah == DAH_NULL );
+		assert( orphp->n_dah == DAH_NULL );
 		Node_unmap( persp->p_orphh, &orphp );
 	}
 }
@@ -740,12 +741,12 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
 
 	/* sanity check - orphino is supposed to be an unused ino!
 	 */
-	ASSERT( ino != orphino );
+	assert( ino != orphino );
 
 	/* lookup head of hardlink list
 	 */
 	hardh = link_hardh( ino, gen );
-	ASSERT( ino != persp->p_rootino || hardh == persp->p_rooth );
+	assert( ino != persp->p_rootino || hardh == persp->p_rooth );
 
 	/* already present
 	 */
@@ -762,7 +763,7 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
 			      gen,
 			      fhdrp->fh_stat.bs_gen );
 			if ( ! tranp->t_toconlypr ) {
-				ASSERT( hardp->n_dah == DAH_NULL );
+				assert( hardp->n_dah == DAH_NULL );
 				hardp->n_dah = dirattr_add( fhdrp );
 			}
 		} else if ( ! tranp->t_toconlypr && hardp->n_dah == DAH_NULL ) {
@@ -829,7 +830,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 
 	/* sanity check - orphino is supposed to be an unused ino!
 	 */
-	ASSERT( ino != orphino );
+	assert( ino != orphino );
 
 	/* don't allow entries named "orphanage" under root to be added
 	 */
@@ -885,7 +886,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 						return RV_ERROR;
 				}
 				if ( hardp->n_lnkh != NH_NULL ) {
-					ASSERT( hardp->n_flags & NF_REAL );
+					assert( hardp->n_flags & NF_REAL );
 					renameh = hardp->n_lnkh;
 					renamep = Node_map( renameh );
 					if ( renamep->n_parh == NH_NULL ) {
@@ -912,7 +913,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 						namreg_get( renamep->n_nrh,
 							    tranp->t_namebuf,
 						    sizeof( tranp->t_namebuf ));
-						ASSERT( namebuflen > 0 );
+						assert( namebuflen > 0 );
 						if ( strcmp( name,
 							   tranp->t_namebuf )) {
 							mlog( MLOG_DEBUG
@@ -944,10 +945,10 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 					nrh_t nrh;
 
 					hardp->n_flags &= ~NF_NEWORPH;
-					ASSERT( hardp->n_nrh == NRH_NULL );
-					ASSERT( hardp->n_parh != NH_NULL );
+					assert( hardp->n_nrh == NRH_NULL );
+					assert( hardp->n_parh != NH_NULL );
 					nrh = disown( hardh );
-					ASSERT( nrh == NRH_NULL );
+					assert( nrh == NRH_NULL );
 					nrh = namreg_add( name, namelen );
 					adopt( parh, hardh, nrh );
 					mlog( MLOG_DEBUG | MLOG_TREE,
@@ -958,13 +959,13 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 					      gen );
 				}
 			} else {
-				ASSERT( hardp->n_nrh != NRH_NULL );
+				assert( hardp->n_nrh != NRH_NULL );
 				namebuflen
 				=
 				namreg_get( hardp->n_nrh,
 					    tranp->t_namebuf,
 					    sizeof( tranp->t_namebuf ));
-				ASSERT( namebuflen > 0 );
+				assert( namebuflen > 0 );
 				if ( hardp->n_parh == parh
 				     &&
 				     ! strcmp( tranp->t_namebuf, name )) {
@@ -1021,7 +1022,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 						Node_unmap( renameh, &renamep );
 					}
 					renamep = Node_map( renameh );
-					ASSERT( hardp->n_parh != NH_NULL );
+					assert( hardp->n_parh != NH_NULL );
 					if ( hardp->n_parh != parh ) {
 						/* different parent
 						 */
@@ -1220,7 +1221,7 @@ tree_post( char *path1, char *path2 )
 	}
 
 #ifdef TREE_CHK
-	ASSERT( tree_chk( ));
+	assert( tree_chk( ));
 #endif /* TREE_CHK */
 
 	/* rename directories
@@ -1238,7 +1239,7 @@ tree_post( char *path1, char *path2 )
 	}
 
 #ifdef TREE_CHK
-	ASSERT( tree_chk( ));
+	assert( tree_chk( ));
 #endif /* TREE_CHK */
 
 	/* process hard links
@@ -1321,7 +1322,7 @@ noref_elim_recurse( nh_t parh,
 			if ( ! isrefpr ) {
 				nrh_t nrh;
 
-				ASSERT( ! isrenamepr );
+				assert( ! isrenamepr );
 				if ( isrealpr ) {
 					ok = Node2path( cldh, path1, _("rmdir") );
 					if ( ! ok ) {
@@ -1346,7 +1347,7 @@ noref_elim_recurse( nh_t parh,
 					}
 				}
 				nrh = disown( cldh );
-				ASSERT( nrh != NRH_NULL );
+				assert( nrh != NRH_NULL );
 				namreg_del( nrh );
 				link_out( cldh );
 				Node_free( &cldh );
@@ -1356,8 +1357,8 @@ noref_elim_recurse( nh_t parh,
 				nrh_t nrh;
 				node_t *renamep;
 
-				ASSERT( isrefpr );
-				ASSERT( isrealpr );
+				assert( isrefpr );
+				assert( isrealpr );
 				ok = Node2path( cldh,
 						path1,
 						_("tmp dir rename src") );
@@ -1366,7 +1367,7 @@ noref_elim_recurse( nh_t parh,
 					continue;
 				}
 				nrh = disown( cldh );
-				ASSERT( nrh != NRH_NULL );
+				assert( nrh != NRH_NULL );
 				adopt( persp->p_orphh, cldh, NRH_NULL );
 				ok = Node2path( cldh,
 						path2,
@@ -1375,7 +1376,7 @@ noref_elim_recurse( nh_t parh,
 					/* REFERENCED */
 					nrh_t dummynrh;
 					dummynrh = disown( cldh );
-					ASSERT( dummynrh == NRH_NULL );
+					assert( dummynrh == NRH_NULL );
 					adopt( parh, cldh, nrh );
 					cldh = nextcldh;
 					continue;
@@ -1395,7 +1396,7 @@ noref_elim_recurse( nh_t parh,
 					      path2,
 					      strerror( errno ));
 					dummynrh = disown( cldh );
-					ASSERT( dummynrh == NRH_NULL );
+					assert( dummynrh == NRH_NULL );
 					adopt( parh, cldh, nrh );
 					cldh = nextcldh;
 					continue;
@@ -1436,7 +1437,7 @@ noref_elim_recurse( nh_t parh,
 				nh_t hardh;
 				bool_t neededpr;
 				hardh = link_hardh( ino, gen );
-				ASSERT( hardh != NH_NULL );
+				assert( hardh != NH_NULL );
 				canunlinkpr = BOOL_FALSE;
 				neededpr = BOOL_FALSE;
 				/* tes@sgi.com:
@@ -1475,7 +1476,7 @@ noref_elim_recurse( nh_t parh,
 			if ( mustorphpr ) {
 				/* rename file to orphanage */
 				nrh_t nrh;
-				ASSERT( ! canunlinkpr );
+				assert( ! canunlinkpr );
 				ok = Node2path( cldh,
 						path1,
 						_("tmp nondir rename src") );
@@ -1484,7 +1485,7 @@ noref_elim_recurse( nh_t parh,
 					continue;
 				}
 				nrh = disown( cldh );
-				ASSERT( nrh != NRH_NULL );
+				assert( nrh != NRH_NULL );
 				adopt( persp->p_orphh, cldh, NRH_NULL );
 				ok = Node2path( cldh,
 						path2,
@@ -1493,7 +1494,7 @@ noref_elim_recurse( nh_t parh,
 					/* REFERENCED */
 					nrh_t dummynrh;
 					dummynrh = disown( cldh );
-					ASSERT( dummynrh == NRH_NULL );
+					assert( dummynrh == NRH_NULL );
 					adopt( parh, cldh, nrh );
 					cldh = nextcldh;
 					continue;
@@ -1513,7 +1514,7 @@ noref_elim_recurse( nh_t parh,
 					      path2,
 					      strerror( errno ));
 					dummynrh = disown( cldh );
-					ASSERT( dummynrh == NRH_NULL );
+					assert( dummynrh == NRH_NULL );
 					adopt( parh, cldh, nrh );
 					cldh = nextcldh;
 					continue;
@@ -1527,7 +1528,7 @@ noref_elim_recurse( nh_t parh,
 				/* REFERENCED */
 				nrh_t nrh;
 
-				ASSERT( ! mustorphpr );
+				assert( ! mustorphpr );
 				if ( isrealpr ) {
 					ok = Node2path( cldh, path1, _("rmdir") );
 					if ( ! ok ) {
@@ -1553,7 +1554,7 @@ noref_elim_recurse( nh_t parh,
 					}
 				}
 				nrh = disown( cldh );
-				ASSERT( nrh != NRH_NULL );
+				assert( nrh != NRH_NULL );
 				link_out( cldh );
 				Node_free( &cldh );
 			}
@@ -1662,7 +1663,7 @@ rename_dirs( nh_t cldh,
 		isrenamepr = isdirpr && renameh != NH_NULL;
 		nextcldh = cldp->n_sibh;
 		Node_unmap( cldh, &cldp );
-		ASSERT( parh == persp->p_orphh );
+		assert( parh == persp->p_orphh );
 
 		if ( isrenamepr ) {
 			node_t *renamep;
@@ -1681,12 +1682,12 @@ rename_dirs( nh_t cldh,
 				continue;
 			}
 			dummynrh = disown( cldh );
-			ASSERT( dummynrh == NRH_NULL );
+			assert( dummynrh == NRH_NULL );
 			adopt( newparh, cldh, newnrh );
 			ok = Node2path( cldh, path2, _("rename dir") );
 			if ( ! ok ) {
 				dummynrh = disown( cldh );
-				ASSERT( dummynrh == newnrh );
+				assert( dummynrh == newnrh );
 				adopt( persp->p_orphh, cldh, NRH_NULL );
 				cldp = Node_map( cldh );
 				cldp->n_nrh = NRH_NULL;
@@ -1707,7 +1708,7 @@ rename_dirs( nh_t cldh,
 				      path2,
 				      strerror( errno ));
 				dummynrh = disown( cldh );
-				ASSERT( dummynrh == newnrh );
+				assert( dummynrh == newnrh );
 				adopt( persp->p_orphh, cldh, NRH_NULL );
 				cldh = nextcldh;
 				continue;
@@ -1964,7 +1965,7 @@ tree_cb_links( xfs_ino_t ino,
 			link_in( nh );
 			adopt( persp->p_orphh, nh, NRH_NULL );
 			ok = Node2path( nh, path1, _("orphan") );
-			ASSERT( ok );
+			assert( ok );
 			( void )( * funcp )( contextp, BOOL_FALSE, path1,path2);
 		}
 	}
@@ -2271,7 +2272,7 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 			}
 			continue;
 		}
-		ASSERT( 0 );
+		assert( 0 );
 	}
 
 	/* now pass through dst list, doing renames if src list not empty,
@@ -2700,7 +2701,7 @@ restart:
 	preamblestr[ preamblecnt++ ] = "\n";
 	preamblestr[ preamblecnt++ ] = fold;
 	preamblestr[ preamblecnt++ ] = "\n\n";
-	ASSERT( preamblecnt <= PREAMBLEMAX );
+	assert( preamblecnt <= PREAMBLEMAX );
 	dlog_begin( preamblestr, preamblecnt );
 
 	/* execute commands until time to extract or quit. always begin with
@@ -2736,9 +2737,9 @@ restart:
 		} else if ( responseix == abortix ) {
 			ackstr[ ackcnt++ ] = _("abort\n");
 		} else {
-			ASSERT( responseix == okix );
+			assert( responseix == okix );
 		}
-		ASSERT( ackcnt <= ACKMAX );
+		assert( ackcnt <= ACKMAX );
 		dlog_string_ack( ackstr,
 				 ackcnt );
 
@@ -2753,7 +2754,7 @@ restart:
 			postamblestr[ postamblecnt++ ] = "\n";
 			postamblestr[ postamblecnt++ ] = fold;
 			postamblestr[ postamblecnt++ ] = "\n\n";
-			ASSERT( postamblecnt <= POSTAMBLEMAX );
+			assert( postamblecnt <= POSTAMBLEMAX );
 			dlog_end( postamblestr, postamblecnt );
 
 			/* if sighup or sigquit, immediately quit
@@ -2765,7 +2766,7 @@ restart:
 			/* if sigint, allow main thread to decide if
 			 * operator really wants to quit
 			 */
-			ASSERT( responseix == sigintix );
+			assert( responseix == sigintix );
 			if ( cldmgr_stop_requested( )) {
 				return BOOL_FALSE;
 			}
@@ -2794,7 +2795,7 @@ restart:
 	postamblestr[ postamblecnt++ ] = "\n";
 	postamblestr[ postamblecnt++ ] = fold;
 	postamblestr[ postamblecnt++ ] = "\n\n";
-	ASSERT( postamblecnt <= POSTAMBLEMAX );
+	assert( postamblecnt <= POSTAMBLEMAX );
 	dlog_end( postamblestr, postamblecnt );
 
 	/* pv 773569 - quit is not a reason to consider session
@@ -2846,7 +2847,7 @@ tsi_cmd_pwd_recurse( void *ctxp,
 	register intgen_t namelen;
 	nrh_t nrh;
 
-	ASSERT( nh != NH_NULL );
+	assert( nh != NH_NULL );
 
 	np = Node_map( nh );
 	nrh = np->n_nrh;
@@ -2857,11 +2858,11 @@ tsi_cmd_pwd_recurse( void *ctxp,
 			/* RECURSION */
 		( * pcb )( pctxp, "/" );
 	}
-	ASSERT( nrh != NRH_NULL );
+	assert( nrh != NRH_NULL );
 	namelen = namreg_get( nrh,
 			      tranp->t_inter.i_name,
 			      sizeof( tranp->t_inter.i_name ));
-	ASSERT( namelen > 0 );
+	assert( namelen > 0 );
 	( * pcb )( pctxp, tranp->t_inter.i_name );
 }
 
@@ -2933,7 +2934,7 @@ tsi_cmd_ls( void *ctxp,
 			namelen = namreg_get( nrh,
 					      tranp->t_inter.i_name,
 					      sizeof( tranp->t_inter.i_name ));
-			ASSERT( namelen > 0 );
+			assert( namelen > 0 );
 			( * pcb )( pctxp,
 				   "    %s %10llu %s%s\n",
 				   isselpr ? "*" : " ",
@@ -2983,7 +2984,7 @@ tsi_cmd_cd( void *ctxp,
 	/* if named is not a dir, complain
 	 */
 	if ( ! isdirpr ) {
-		ASSERT( arg );
+		assert( arg );
 		( * pcb )( pctxp,
 			   _("%s is not a directory\n"),
 			   arg );
@@ -3152,7 +3153,7 @@ tsi_cmd_match( void )
 		return 0;
 	}
 
-	ASSERT( tblp->tct_argcmin != 0 );
+	assert( tblp->tct_argcmin != 0 );
 	if ( tranp->t_inter.i_argc < tblp->tct_argcmin ) {
 		return 0;
 	}
@@ -3224,11 +3225,11 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
 	 * or at the current working directory
 	 */
 	if ( path && *path == '/' ) {
-		ASSERT( rooth != NH_NULL );
+		assert( rooth != NH_NULL );
 		namedh = rooth;
 		path++;
 	} else {
-		ASSERT( cwdh != NH_NULL );
+		assert( cwdh != NH_NULL );
 		namedh = cwdh;
 	}
 
@@ -3239,7 +3240,7 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
 	cldh = namedp->n_cldh;
 	ino = namedp->n_ino;
 	isselpr = ( namedp->n_flags & NF_SUBTREE );
-	ASSERT( namedp->n_flags & NF_ISDIR );
+	assert( namedp->n_flags & NF_ISDIR );
 	Node_unmap( namedh, &namedp );
 	isdirpr = BOOL_TRUE;
 
@@ -3278,12 +3279,12 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
 		 * the path pointer.
 		 */
 		namelen = strcspn( path, "/" );
-		ASSERT( namelen < sizeof( nbuf ));
+		assert( namelen < sizeof( nbuf ));
 		strncpy( nbuf, path, namelen );
 		nbuf[ namelen ] = 0;
 		path += namelen;
 		if ( *path ) {
-			ASSERT( *path == '/' );
+			assert( *path == '/' );
 			strpatchp = path;
 			*strpatchp = 0;
 			path++;
@@ -3353,12 +3354,12 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
 			isselpr = ( sibp->n_flags & NF_SUBTREE );
 			isdirpr = ( sibp->n_flags & NF_ISDIR );
 			Node_unmap( sibh, &sibp );
-			ASSERT( nrh != NRH_NULL || sibh == persp->p_orphh );
+			assert( nrh != NRH_NULL || sibh == persp->p_orphh );
 			if ( nrh != NRH_NULL ) {
 				siblen = namreg_get( nrh,
 						     tranp->t_inter.i_name,
 					       sizeof( tranp->t_inter.i_name ));
-				ASSERT( siblen > 0 );
+				assert( siblen > 0 );
 				if ( ! strcmp( nbuf, tranp->t_inter.i_name )) {
 					break;
 				}
@@ -3523,7 +3524,7 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
 	/* if we have a cache hit, no need to recurse any further
 	 */
 	if ( nh == cache.nh ) {
-		ASSERT( bufsz > cache.len );
+		assert( bufsz > cache.len );
 		strcpy( buf, cache.buf );
 		return bufsz - cache.len;
 	}
@@ -3550,7 +3551,7 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
 	/* insert slash if parent not root
 	 */
 	if ( parh != persp->p_rooth ) {
-		ASSERT( bufsz + MAXPATHLEN >= 2 );
+		assert( bufsz + MAXPATHLEN >= 2 );
 		*buf++ = '/';
 		*( buf + 1 ) = 0;
 		bufsz--;
@@ -3566,15 +3567,15 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
 	} else if ( nh == persp->p_orphh ) {
 		namelen = sprintf( buf, "%s", orphname );
 	} else {
-		ASSERT( nrh != NRH_NULL );
+		assert( nrh != NRH_NULL );
 		namelen = namreg_get( nrh, buf, ( size_t )bufsz + MAXPATHLEN );
-		ASSERT( namelen > 0 );
+		assert( namelen > 0 );
 	}
 
 	/* update remaining buffer size
 	 */
 	bufsz -= namelen;
-	ASSERT( bufsz + MAXPATHLEN > 0 );
+	assert( bufsz + MAXPATHLEN > 0 );
 
 	/* update the cache if we're the target's parent
 	 * (and the pathname is not too long)
@@ -3639,7 +3640,7 @@ disown( nh_t cldh )
 	nrh = cldp->n_nrh;
 
 	parh = cldp->n_parh;
-	ASSERT( parh != NH_NULL );
+	assert( parh != NH_NULL );
 	if ( parh == NH_NULL ) {
 		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 		      "attempt to disown child "
@@ -3647,7 +3648,7 @@ disown( nh_t cldh )
 		return nrh;
 	}
 	parp = Node_map( parh );
-	ASSERT( parp->n_cldh != NH_NULL );
+	assert( parp->n_cldh != NH_NULL );
 	if ( parp->n_cldh == NH_NULL ) {
 		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
 		      "attempt to disown child "
@@ -3668,7 +3669,7 @@ disown( nh_t cldh )
 		nh_t prevcldh = cldp->n_sibprevh;
 		node_t *prevcldp;
 
-		ASSERT(prevcldh != NH_NULL); /* must be a previous */
+		assert(prevcldh != NH_NULL); /* must be a previous */
 		prevcldp = Node_map( prevcldh );
 
 		/* fix up previous */
@@ -3865,7 +3866,7 @@ link_matchh( nh_t hardh, nh_t parh, char *name )
 			namelen = namreg_get( np->n_nrh,
 					      tranp->t_namebuf,
 					      sizeof( tranp->t_namebuf ));
-			ASSERT( namelen > 0 );
+			assert( namelen > 0 );
 			if ( ! strcmp( name, tranp->t_namebuf )) {
 				Node_unmap( hardh, &np );
 				break;
@@ -3955,7 +3956,7 @@ link_out( nh_t nh )
 	/* get head of hard link list
 	 */
 	hardh = hash_find( ino, gen );
-	ASSERT( hardh != NH_NULL );
+	assert( hardh != NH_NULL );
 
 	/* if node is at head of hard link list, hash it out and
 	 * hash in the following node in link list, if there is one.
@@ -3973,7 +3974,7 @@ link_out( nh_t nh )
 			nh_t nexth = prevp->n_lnkh;
 			Node_unmap( prevh, &prevp  );
 			prevh = nexth;
-			ASSERT( prevh != NH_NULL );
+			assert( prevh != NH_NULL );
 			prevp = Node_map( prevh );
 		}
 		prevp->n_lnkh = np->n_lnkh;
@@ -4033,7 +4034,7 @@ link_iter_next( link_iter_context_t *link_iter_contextp )
 	/* if no last, must be first call
 	 */
 	if ( tmplasth == NH_NULL ) {
-		ASSERT( link_iter_contextp->li_prevh == NH_NULL );
+		assert( link_iter_contextp->li_prevh == NH_NULL );
 		link_iter_contextp->li_lasth = link_iter_contextp->li_headh;
 		return link_iter_contextp->li_lasth;
 	}
@@ -4065,8 +4066,8 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
 
 	/* sanity checks
 	 */
-	ASSERT( link_iter_contextp->li_lasth != NH_NULL );
-	ASSERT( nh == link_iter_contextp->li_lasth );
+	assert( link_iter_contextp->li_lasth != NH_NULL );
+	assert( nh == link_iter_contextp->li_lasth );
 
 	/* get the next node in list
 	 */
@@ -4076,7 +4077,7 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
 	Node_unmap( link_iter_contextp->li_lasth, &lastp );
 
 	if ( link_iter_contextp->li_lasth == link_iter_contextp->li_headh ) {
-		ASSERT( link_iter_contextp->li_prevh == NH_NULL );
+		assert( link_iter_contextp->li_prevh == NH_NULL );
 		hash_out( link_iter_contextp->li_headh );
 		link_iter_contextp->li_headh = nexth;
 		if ( nexth != NH_NULL ) {
@@ -4084,7 +4085,7 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
 		}
 	} else {
 		node_t *prevp;
-		ASSERT( link_iter_contextp->li_prevh != NH_NULL );
+		assert( link_iter_contextp->li_prevh != NH_NULL );
 		prevp = Node_map( link_iter_contextp->li_prevh );
 		prevp->n_lnkh = nexth;
 		Node_unmap( link_iter_contextp->li_prevh, &prevp );
@@ -4112,7 +4113,7 @@ hash_init( size64_t vmsz,
 
 	/* sanity checks
 	 */
-	ASSERT( pgsz % sizeof( nh_t ) == 0 );
+	assert( pgsz % sizeof( nh_t ) == 0 );
 
 	/* calculate the size of the hash array. must be a power of two,
 	 * and a multiple of the page size. don't use more than the available
@@ -4130,11 +4131,11 @@ hash_init( size64_t vmsz,
 	      ;
 	      loghashlen++ )
 		;
-	ASSERT( loghashlen > 0 );
+	assert( loghashlen > 0 );
 	hashlen = ( size64_t )1 << loghashlen;
 	if (hashlen > hashlenmax)
 		hashlen >>= 1;
-	ASSERT( hashlen <= hashlenmax );
+	assert( hashlen <= hashlenmax );
 
 	/* record hash size in persistent state
 	 */
@@ -4142,9 +4143,9 @@ hash_init( size64_t vmsz,
 
 	/* map the hash array just after the persistent state header
 	 */
-	ASSERT( persp->p_hashsz <= SIZEMAX );
-	ASSERT( ! ( persp->p_hashsz % ( size64_t )pgsz ));
-	ASSERT( ! ( PERSSZ % pgsz ));
+	assert( persp->p_hashsz <= SIZEMAX );
+	assert( ! ( persp->p_hashsz % ( size64_t )pgsz ));
+	assert( ! ( PERSSZ % pgsz ));
 	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
 					    ( size_t )persp->p_hashsz,
 					    tranp->t_persfd,
@@ -4166,7 +4167,7 @@ hash_init( size64_t vmsz,
 	/* build a hash mask. this works because hashlen is a power of two.
 	 * record in persistent state.
 	 */
-	ASSERT( hashlen - 1 <= SIZEMAX );
+	assert( hashlen - 1 <= SIZEMAX );
 	persp->p_hashmask = ( size_t )( hashlen - 1 );
 
 	return BOOL_TRUE;
@@ -4179,18 +4180,18 @@ hash_sync( char *perspath )
 
 	/* sanity checks
 	 */
-	ASSERT( pgsz % sizeof( nh_t ) == 0 );
+	assert( pgsz % sizeof( nh_t ) == 0 );
 
 	/* retrieve the hash size from the persistent state
 	 */
 	hashsz = persp->p_hashsz;
-	ASSERT( ! ( hashsz % sizeof( nh_t )));
+	assert( ! ( hashsz % sizeof( nh_t )));
 
 	/* map the hash array just after the persistent state header
 	 */
-	ASSERT( hashsz <= SIZEMAX );
-	ASSERT( ! ( hashsz % ( size64_t )pgsz ));
-	ASSERT( ! ( PERSSZ % pgsz ));
+	assert( hashsz <= SIZEMAX );
+	assert( ! ( hashsz % ( size64_t )pgsz ));
+	assert( ! ( PERSSZ % pgsz ));
 	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
 					    ( size_t )hashsz,
 					    tranp->t_persfd,
@@ -4236,7 +4237,7 @@ hash_in( nh_t nh )
 	
 	/* assert not already in
 	 */
-	ASSERT( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
+	assert( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
 
 	/* calculate the hash index
 	 */
@@ -4248,7 +4249,7 @@ hash_in( nh_t nh )
 
 	/* insert into the list, at the head
 	 */
-	ASSERT( np->n_hashh == NH_NULL );
+	assert( np->n_hashh == NH_NULL );
 	np->n_hashh = *entryp;
 	*entryp = nh;
 
@@ -4282,7 +4283,7 @@ hash_out( nh_t nh )
 	/* get the handle of the first node in the appropriate hash array
 	 */
 	hashheadh = *entryp;
-	ASSERT( hashheadh != NH_NULL );
+	assert( hashheadh != NH_NULL );
 	
 	/* if node is first in list, replace entry with following node.
 	 * otherwise, walk the list until found.
@@ -4296,7 +4297,7 @@ hash_out( nh_t nh )
 			nh_t nexth = prevp->n_hashh;
 			Node_unmap( prevh, &prevp  );
 			prevh = nexth;
-			ASSERT( prevh != NH_NULL );
+			assert( prevh != NH_NULL );
 			prevp = Node_map( prevh );
 		}
 		prevp->n_hashh = np->n_hashh;
@@ -4412,11 +4413,11 @@ Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
 		*nexthashhp = NH_NULL;
 	}
 
-	ASSERT( nextlnkhp );
+	assert( nextlnkhp );
 	*nextlnkhp = NH_NULL;
 
 	np = Node_map( nh );
-	ASSERT( np );
+	assert( np );
 	n = *np;
 	Node_unmap( nh, &np );
 
@@ -4456,7 +4457,7 @@ Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
 	if ( n.n_nrh != NRH_NULL ) {
 		intgen_t rval;
 		rval = namreg_get( n.n_nrh, nambuf, sizeof( nambuf ));
-		ASSERT( rval >= 0 );
+		assert( rval >= 0 );
 	}
 
 	if ( n.n_dah != DAH_NULL ) {
@@ -4539,7 +4540,7 @@ tree_chk2_recurse( nh_t cldh, nh_t parh )
 {
 	bool_t okaccum = BOOL_TRUE;
 
-	ASSERT( parh != NH_NULL );
+	assert( parh != NH_NULL );
 
 	while ( cldh != NH_NULL ) {
 		node_t *cldp;
@@ -4569,7 +4570,7 @@ tree_chk2_recurse( nh_t cldh, nh_t parh )
 			namelen = namreg_get( nrh,
 					      tranp->t_namebuf,
 					      sizeof( tranp->t_namebuf ));
-			ASSERT( namelen >= 0 );
+			assert( namelen >= 0 );
 		}
 
 		if ( nodeparh == NH_NULL ) {
@@ -4631,7 +4632,7 @@ parse( int slotcnt, char **slotbuf, char *string )
 
 	/* sanity checkcs
 	 */
-	ASSERT( slotcnt >= 0 );
+	assert( slotcnt >= 0 );
 
 	/* allocate a companion to the input string for identifying
 	 * characters which are to be interpreted literally.
diff --git a/restore/win.c b/restore/win.c
index 0f3b573..a9f0239 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 #include <memory.h>
 #include <errno.h>
+#include <assert.h>
 
 #include "types.h"
 #include "mlog.h"
@@ -153,14 +154,14 @@ win_init( intgen_t fd,
 {
 	/* validate parameters
 	 */
-	ASSERT( ( firstoff & ( off64_t )pgmask ) == 0 );
-	ASSERT( ( segsz & pgmask ) == 0 );
+	assert( ( firstoff & ( off64_t )pgmask ) == 0 );
+	assert( ( segsz & pgmask ) == 0 );
 
 	/* allocate and initialize transient state
 	 */
-	ASSERT( tranp == 0 );
+	assert( tranp == 0 );
 	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
-	ASSERT( tranp );
+	assert( tranp );
 
 	tranp->t_fd = fd;
 	tranp->t_firstoff = firstoff;
@@ -170,7 +171,7 @@ win_init( intgen_t fd,
 	tranp->t_segmaplen = SEGMAP_INCR;
 	tranp->t_segmap = (win_t **)
 	calloc( tranp->t_segmaplen, sizeof(win_t *) );
-	ASSERT( tranp->t_segmap );
+	assert( tranp->t_segmap );
 
 	/* initialize critical region enforcer
 	 */
@@ -203,8 +204,8 @@ win_map( segix_t segix, void **pp )
 		     "win_map(): requested segment already mapped\n");
 #endif
 		if ( winp->w_refcnt == 0 ) {
-			ASSERT( tranp->t_lruheadp );
-			ASSERT( tranp->t_lrutailp );
+			assert( tranp->t_lruheadp );
+			assert( tranp->t_lrutailp );
 			if ( tranp->t_lruheadp == winp ) {
 				if ( tranp->t_lrutailp == winp ) {
 					tranp->t_lruheadp = 0;
@@ -225,8 +226,8 @@ win_map( segix_t segix, void **pp )
 			winp->w_prevp = 0;
 			winp->w_nextp = 0;
 		} else {
-			ASSERT( ! winp->w_prevp );
-			ASSERT( ! winp->w_nextp );
+			assert( ! winp->w_prevp );
+			assert( ! winp->w_nextp );
 		}
 		winp->w_refcnt++;
 		*pp = winp->w_p;
@@ -243,7 +244,7 @@ win_map( segix_t segix, void **pp )
 		     "win_map(): create a new window\n");
 #endif
 		winp = ( win_t * )calloc( 1, sizeof( win_t ));
-		ASSERT( winp );
+		assert( winp );
 		tranp->t_wincnt++;
 	} else if ( tranp->t_lruheadp ) {
 		/* REFERENCED */
@@ -252,7 +253,7 @@ win_map( segix_t segix, void **pp )
 		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 		     "win_map(): get head from lru freelist & unmap\n");
 #endif
-		ASSERT( tranp->t_lrutailp );
+		assert( tranp->t_lrutailp );
 		winp = tranp->t_lruheadp;
 		tranp->t_lruheadp = winp->w_nextp;
 		if ( tranp->t_lruheadp ) {
@@ -262,10 +263,10 @@ win_map( segix_t segix, void **pp )
 		}
 		tranp->t_segmap[winp->w_segix] = NULL;
 		rval = munmap( winp->w_p, tranp->t_segsz );
-		ASSERT( ! rval );
+		assert( ! rval );
 		memset( ( void * )winp, 0, sizeof( win_t ));
 	} else {
-		ASSERT( tranp->t_wincnt == tranp->t_winmax );
+		assert( tranp->t_wincnt == tranp->t_winmax );
 		*pp = NULL;
 		CRITICAL_END();
 		mlog( MLOG_NORMAL | MLOG_WARNING, _(
@@ -279,12 +280,12 @@ win_map( segix_t segix, void **pp )
 
 	/* map the window
 	 */
-	ASSERT( tranp->t_segsz >= 1 );
-	ASSERT( tranp->t_firstoff
+	assert( tranp->t_segsz >= 1 );
+	assert( tranp->t_firstoff
 		<=
 		OFF64MAX - segoff - ( off64_t )tranp->t_segsz + 1ll );
-	ASSERT( ! ( tranp->t_segsz % pgsz ));
-	ASSERT( ! ( ( tranp->t_firstoff + segoff ) % ( off64_t )pgsz ));
+	assert( ! ( tranp->t_segsz % pgsz ));
+	assert( ! ( ( tranp->t_firstoff + segoff ) % ( off64_t )pgsz ));
 #ifdef TREE_DEBUG
 	mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 	     "win_map(): mmap segment at %lld, size = %llu\n",
@@ -317,7 +318,7 @@ win_map( segix_t segix, void **pp )
 		return;
 	}
 	winp->w_segix  = segix;
-	ASSERT( winp->w_refcnt == 0 );
+	assert( winp->w_refcnt == 0 );
 	winp->w_refcnt++;
 	tranp->t_segmap[winp->w_segix] = winp;
 
@@ -335,36 +336,36 @@ win_unmap( segix_t segix, void **pp )
 
 	/* verify window mapped
 	 */
-	ASSERT( segix < tranp->t_segmaplen );
+	assert( segix < tranp->t_segmaplen );
 	winp = tranp->t_segmap[segix];
-	ASSERT( winp );
+	assert( winp );
 
 	/* validate p
 	 */
-	ASSERT( pp );
-	ASSERT( *pp );
-	ASSERT( *pp >= winp->w_p );
-	ASSERT( *pp < ( void * )( ( char * )( winp->w_p ) + tranp->t_segsz ));
+	assert( pp );
+	assert( *pp );
+	assert( *pp >= winp->w_p );
+	assert( *pp < ( void * )( ( char * )( winp->w_p ) + tranp->t_segsz ));
 
 	/* decrement the reference count. if zero, place at tail of LRU list.
 	 */
-	ASSERT( winp->w_refcnt > 0 );
+	assert( winp->w_refcnt > 0 );
 	winp->w_refcnt--;
-	ASSERT( ! winp->w_prevp );
-	ASSERT( ! winp->w_nextp );
+	assert( ! winp->w_prevp );
+	assert( ! winp->w_nextp );
 	if ( winp->w_refcnt == 0 ) {
 		if ( tranp->t_lrutailp ) {
-			ASSERT( tranp->t_lruheadp );
+			assert( tranp->t_lruheadp );
 			winp->w_prevp = tranp->t_lrutailp;
 			tranp->t_lrutailp->w_nextp = winp;
 			tranp->t_lrutailp = winp;
 		} else {
-			ASSERT( ! tranp->t_lruheadp );
-			ASSERT( ! winp->w_prevp );
+			assert( ! tranp->t_lruheadp );
+			assert( ! winp->w_prevp );
 			tranp->t_lruheadp = winp;
 			tranp->t_lrutailp = winp;
 		}
-		ASSERT( ! winp->w_nextp );
+		assert( ! winp->w_nextp );
 	}
 
 	/* zero the caller's pointer
@@ -385,7 +386,7 @@ win_segmap_resize(segix_t segix)
 	tranp->t_segmaplen = segix + SEGMAP_INCR;
 	tranp->t_segmap = (win_t **)
 		realloc( tranp->t_segmap, tranp->t_segmaplen * sizeof(win_t *) );
-	ASSERT( tranp->t_segmap );
+	assert( tranp->t_segmap );
 
 	/* clear the new portion of the array */
 	new_part = tranp->t_segmap + oldlen;
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/8] build: don't rely on xfs/xfs.h to include necessary headers
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
  2015-10-16  1:44 ` [PATCH 1/8] cleanup: get rid of ASSERT Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-16  1:44 ` [PATCH 3/8] cleanup: kill intgen_t Dave Chinner
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

>From xfsprogs 4.2.0, the xfs headers no long include lots of
xfsprogs specific build information. xfsdump hasbeen implicitly
relying on those header for a clean build, rather than having it's
own definitions. Hence we need to add the missing bits to
config.h.in and include it in all the files that require the
specific help that the xfs headers used to provide.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/arch_xlate.c     |  4 ++++
 common/arch_xlate.h     |  1 +
 common/cldmgr.c         |  4 ++++
 common/content_common.c |  4 ++++
 common/dlog.c           |  4 ++++
 common/drive.c          |  3 +++
 common/drive_minrmt.c   |  5 +++++
 common/drive_scsitape.c |  5 +++++
 common/drive_simple.c   |  5 +++++
 common/fs.c             |  4 ++++
 common/global.c         |  4 ++++
 common/hsmapi.c         |  4 ++++
 common/lock.c           |  2 ++
 common/main.c           |  5 +++++
 common/media.c          |  2 ++
 common/mlog.c           |  3 +++
 common/openutil.c       |  5 +++++
 common/path.c           |  7 +++++++
 common/qlock.c          |  2 ++
 common/ring.c           |  2 ++
 common/stream.c         |  3 +++
 common/util.c           |  5 +++++
 dump/content.c          |  5 +++++
 dump/inomap.c           |  5 +++++
 dump/var.c              |  5 +++++
 include/config.h.in     | 45 +++++++++++++++++++++++++++++++++++----------
 inventory/inv_api.c     |  5 +++++
 inventory/inv_core.c    |  5 +++++
 inventory/inv_files.c   |  3 +++
 inventory/inv_fstab.c   |  5 +++++
 inventory/inv_idx.c     |  5 +++++
 inventory/inv_mgr.c     |  5 +++++
 inventory/inv_oref.c    |  2 ++
 inventory/inv_stobj.c   |  5 +++++
 inventory/testmain.c    |  4 ++++
 invutil/cmenu.c         |  3 +++
 invutil/fstab.c         |  3 +++
 invutil/invidx.c        |  4 ++++
 invutil/invutil.c       |  4 ++++
 invutil/screen.c        |  3 +++
 invutil/stobj.c         |  4 ++++
 librmt/rmtabort.c       |  1 +
 librmt/rmtclose.c       |  1 +
 librmt/rmtcommand.c     |  2 ++
 librmt/rmtfstat.c       |  2 ++
 librmt/rmtioctl.c       | 10 ++++++----
 librmt/rmtlib.h         |  3 ---
 librmt/rmtlseek.c       |  2 ++
 librmt/rmtmsg.c         |  5 +++++
 librmt/rmtopen.c        |  4 +++-
 librmt/rmtread.c        |  2 ++
 librmt/rmtstatus.c      |  2 ++
 librmt/rmtwrite.c       |  2 ++
 restore/bag.c           |  2 ++
 restore/content.c       |  5 +++++
 restore/dirattr.c       |  5 +++++
 restore/inomap.c        |  5 +++++
 restore/namreg.c        |  5 +++++
 restore/node.c          |  4 ++++
 restore/tree.c          |  7 +++++++
 restore/win.c           |  2 ++
 61 files changed, 256 insertions(+), 18 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index e6f897e..f8aa50f 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -20,6 +20,10 @@
 #include <xfs/jdm.h>
 #include <assert.h>
 
+#include <strings.h>
+
+#include "config.h"
+
 #include "arch_xlate.h"
 #include "types.h"
 #include "global.h"
diff --git a/common/arch_xlate.h b/common/arch_xlate.h
index 35333c6..fa201cd 100644
--- a/common/arch_xlate.h
+++ b/common/arch_xlate.h
@@ -22,6 +22,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <strings.h>
 #include "types.h"
 #include "global.h"
 #include "content.h"
diff --git a/common/cldmgr.c b/common/cldmgr.c
index df33a3f..88fd7fd 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -26,6 +27,9 @@
 #include <errno.h>
 #include <pthread.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "exit.h"
 #include "types.h"
diff --git a/common/content_common.c b/common/content_common.c
index 65be31f..99b1a4b 100644
--- a/common/content_common.c
+++ b/common/content_common.c
@@ -19,12 +19,16 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <sys/stat.h>
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <signal.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/dlog.c b/common/dlog.c
index 6220cfe..dac4e64 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/select.h>
@@ -27,6 +28,9 @@
 #include <errno.h>
 #include <signal.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "mlog.h"
diff --git a/common/drive.c b/common/drive.c
index f9ba851..afef147 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -22,6 +22,9 @@
 #include <sys/stat.h>
 #include <time.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 6d58f1f..51685dc 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -30,6 +32,9 @@
 #include <malloc.h>
 #include <sched.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 3f45d01..eade6ac 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -30,6 +32,9 @@
 #include <malloc.h>
 #include <sched.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 2e57d8c..69fce4b 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <time.h>
@@ -26,6 +28,9 @@
 #include <malloc.h>
 #include <sched.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/fs.c b/common/fs.c
index b77f6cc..2cd2f72 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -20,6 +20,7 @@
 #include <xfs/jdm.h>
 #include "config.h"
 
+#include <unistd.h>
 #include <sys/stat.h>
 #include <sys/statvfs.h>
 #include <time.h>
@@ -28,6 +29,9 @@
 #include <mntent.h>
 #include <sys/ioctl.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "mlog.h"
diff --git a/common/global.c b/common/global.c
index ed844cc..319d4df 100644
--- a/common/global.c
+++ b/common/global.c
@@ -19,10 +19,14 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <sys/stat.h>
 #include <time.h>
 #include <errno.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 0bca9ff..ed29370 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -21,6 +21,10 @@
 #include <xfs/jdm.h>
 #include <assert.h>
 
+#include <string.h>
+
+#include "config.h"
+
 #include "hsmapi.h"
 #include "mlog.h"
 
diff --git a/common/lock.c b/common/lock.c
index 347f6cd..a237931 100644
--- a/common/lock.c
+++ b/common/lock.c
@@ -20,6 +20,8 @@
 #include <xfs/jdm.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "qlock.h"
 #include "mlog.h"
diff --git a/common/main.c b/common/main.c
index f392856..3b82a76 100644
--- a/common/main.c
+++ b/common/main.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/prctl.h>
@@ -34,6 +36,9 @@
 #include <sched.h>
 #include <pthread.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "exit.h"
 #include "types.h"
diff --git a/common/media.c b/common/media.c
index 53b94d1..7d17405 100644
--- a/common/media.c
+++ b/common/media.c
@@ -28,6 +28,8 @@
 #include <getopt.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "util.h"
 #include "mlog.h"
diff --git a/common/mlog.c b/common/mlog.c
index c546036..1fef185 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -28,6 +28,9 @@
 #include <getopt.h>
 #include <pthread.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "qlock.h"
diff --git a/common/openutil.c b/common/openutil.c
index c3b8d9a..9df42ae 100644
--- a/common/openutil.c
+++ b/common/openutil.c
@@ -18,11 +18,16 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <limits.h>
 #include <errno.h>
 #include <fcntl.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "mlog.h"
diff --git a/common/path.c b/common/path.c
index e40c473..b73121d 100644
--- a/common/path.c
+++ b/common/path.c
@@ -19,6 +19,13 @@
 #include <xfs/xfs.h>
 #include <assert.h>
 
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+
 #include "path.h"
 
 struct pem {
diff --git a/common/qlock.c b/common/qlock.c
index d88917c..1b466d6 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -23,6 +23,8 @@
 #include <semaphore.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "qlock.h"
 #include "mlog.h"
diff --git a/common/ring.c b/common/ring.c
index f3de7c4..37a2d1d 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -29,6 +29,8 @@
 #include <malloc.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "qlock.h"
 #include "cldmgr.h"
diff --git a/common/stream.c b/common/stream.c
index 0db1be3..90d315a 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -21,6 +21,9 @@
 
 #include <pthread.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "exit.h"
diff --git a/common/util.c b/common/util.c
index 1dc6d6c..af48162 100644
--- a/common/util.c
+++ b/common/util.c
@@ -20,12 +20,17 @@
 #include <xfs/jdm.h>
 #include "config.h"
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <dirent.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/dump/content.c b/dump/content.c
index 3682358..5d630bb 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <sys/prctl.h>
 #include <time.h>
@@ -31,6 +33,7 @@
 #include <sys/quota.h>
 #include <malloc.h>
 #include <assert.h>
+#include <string.h>
 
 #ifdef linux
 #include <xfs/xqm.h>
@@ -38,6 +41,8 @@
 
 #include <attr/attributes.h>
 
+#include "config.h"
+
 #include "hsmapi.h"
 
 #include "exit.h"
diff --git a/dump/inomap.c b/dump/inomap.c
index 7a3069f..dacf954 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -20,12 +20,17 @@
 #include <xfs/jdm.h>
 #include <malloc.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <time.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/dump/var.c b/dump/var.c
index 8370fa4..ceb7e3a 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -19,9 +19,14 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/stat.h>
 #include <errno.h>
 #include <dirent.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "fs.h"
diff --git a/include/config.h.in b/include/config.h.in
index 7cc4f2a..ef66ed9 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -6,19 +6,44 @@
 #ifndef __CONFIG_H__
 #define __CONFIG_H__
 
+/* long and pointer must be either 32 bit or 64 bit */
+#undef SIZEOF_LONG
+#undef SIZEOF_CHAR_P
+#define BITS_PER_LONG (SIZEOF_LONG * CHAR_BIT)
+
+/* Check whether to define umode_t ourselves. */
+#ifndef HAVE_UMODE_T
+typedef unsigned short umode_t;
+#endif
+
 /* Define if you want gettext (I18N) support */
 #undef ENABLE_GETTEXT
-
-#ifndef _
-# ifdef ENABLE_GETTEXT
-#  include <libintl.h>
-#   define _(x)			gettext(x)
-# else
-#  define _(x)			(x)
-#  define textdomain(d)		do { } while (0)
-#  define bindtextdomain(d,dir)	do { } while (0)
-# endif
+#ifdef ENABLE_GETTEXT
+# include <libintl.h>
+# define _(x)                   gettext(x)
+# define N_(x)			 x
+#else
+# define _(x)                   (x)
+# define N_(x)			 x
+# define textdomain(d)          do { } while (0)
+# define bindtextdomain(d,dir)  do { } while (0)
 #endif
 #include <locale.h>
 
+#define IRIX_DEV_BITSMAJOR      14
+#define IRIX_DEV_BITSMINOR      18
+#define IRIX_DEV_MAXMAJ         0x1ff
+#define IRIX_DEV_MAXMIN         0x3ffff
+#define IRIX_DEV_MAJOR(dev)	((int)(((unsigned)(dev) >> IRIX_DEV_BITSMINOR) \
+					& IRIX_DEV_MAXMAJ))
+#define IRIX_DEV_MINOR(dev)	((int)((dev) & IRIX_DEV_MAXMIN))
+#define IRIX_MKDEV(major,minor)	((xfs_dev_t)(((major) << IRIX_DEV_BITSMINOR) \
+					| (minor&IRIX_DEV_MAXMIN)))
+#define IRIX_DEV_TO_KDEVT(dev)	makedev(IRIX_DEV_MAJOR(dev),IRIX_DEV_MINOR(dev))
+
+#ifndef min
+#define min(a,b)	(((a)<(b))?(a):(b))
+#define max(a,b)	(((a)>(b))?(a):(b))
+#endif
+
 #endif	/* __CONFIG_H__ */
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index bd473e9..b564d2f 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <fcntl.h>
 #include <time.h>
 #include <stdlib.h>
@@ -27,6 +29,9 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "mlog.h"
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index a83e7ef..7020f7f 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -26,6 +27,10 @@
 #include <errno.h>
 #include <sys/dir.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
+
 #include "types.h"
 #include "inv_priv.h"
 
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index 34b7aac..409ee0d 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -24,6 +24,9 @@
 #include <sys/stat.h>
 #include <sys/dir.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 
 /*----------------------------------------------------------------------*/
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index e87152f..8263852 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -26,6 +28,9 @@
 #include <fcntl.h>
 #include <sys/dir.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "mlog.h"
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index edb72b3..0378c5a 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <stdlib.h>
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -26,6 +27,10 @@
 #include <sys/stat.h>
 #include <sys/dir.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "inv_priv.h"
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 926b4c8..f1341b9 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -19,12 +19,17 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/dir.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "inv_priv.h"
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index b6cd61d..ebcae95 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -20,6 +20,8 @@
 #include <xfs/jdm.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "inv_priv.h"
 #include "inv_oref.h"
 
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 42969b1..bae2fc5 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <time.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -27,6 +29,9 @@
 #include <sys/dir.h>
 #include <sys/mman.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "timeutil.h"
diff --git a/inventory/testmain.c b/inventory/testmain.c
index d8c61e2..51b7774 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -19,10 +19,14 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <stdio.h>
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <assert.h>
+
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "getopt.h"
diff --git a/invutil/cmenu.c b/invutil/cmenu.c
index ff4abef..ce23d28 100644
--- a/invutil/cmenu.c
+++ b/invutil/cmenu.c
@@ -19,9 +19,12 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <ncurses.h>
 #include <signal.h>
 #include <sys/stat.h>
+#include <string.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/fstab.c b/invutil/fstab.c
index acbe94b..ac8f775 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -19,9 +19,12 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <signal.h>
 #include <ncurses.h>
 #include <sys/mman.h>
+#include <string.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 8de137c..b6ce4fa 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -19,9 +19,13 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
 #include <ncurses.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#include <string.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/invutil.c b/invutil/invutil.c
index b75db14..e1c8868 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -19,11 +19,15 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <errno.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <time.h>
 #include <sys/mman.h>
+#include <string.h>
+#include <libgen.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/screen.c b/invutil/screen.c
index 12074f0..c4b79d8 100644
--- a/invutil/screen.c
+++ b/invutil/screen.c
@@ -18,6 +18,9 @@
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
+
+#include <stdio.h>
+#include <string.h>
 #include <ncurses.h>
 
 #include "cmenu.h"
diff --git a/invutil/stobj.c b/invutil/stobj.c
index a74ba0f..eb04385 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -18,9 +18,13 @@
 
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
+
+#include <unistd.h>
+#include <stdlib.h>
 #include <ncurses.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#include <string.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/librmt/rmtabort.c b/librmt/rmtabort.c
index 3efa651..a7db4b1 100644
--- a/librmt/rmtabort.c
+++ b/librmt/rmtabort.c
@@ -21,6 +21,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <unistd.h>
 #include "rmtlib.h"
 
 /*
diff --git a/librmt/rmtclose.c b/librmt/rmtclose.c
index a155366..97f53c7 100644
--- a/librmt/rmtclose.c
+++ b/librmt/rmtclose.c
@@ -21,6 +21,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <unistd.h>
 #include "rmtlib.h"
 
 static int _rmt_close(int);
diff --git a/librmt/rmtcommand.c b/librmt/rmtcommand.c
index fbd7a6a..82c9032 100644
--- a/librmt/rmtcommand.c
+++ b/librmt/rmtcommand.c
@@ -22,6 +22,8 @@
  */
 
 #include <errno.h>
+#include <unistd.h>
+#include <string.h>
 
 #include "rmtlib.h"
 
diff --git a/librmt/rmtfstat.c b/librmt/rmtfstat.c
index 3506567..92a49d7 100644
--- a/librmt/rmtfstat.c
+++ b/librmt/rmtfstat.c
@@ -24,6 +24,8 @@
 #include "rmtlib.h"
 
 #include <errno.h>
+#include <unistd.h>
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 
diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
index 4c108fb..bd6f887 100644
--- a/librmt/rmtioctl.c
+++ b/librmt/rmtioctl.c
@@ -21,17 +21,19 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <unistd.h>
 #include <errno.h>
-
-#include "rmtlib.h"
-#include "swap.h"
-
 #include <sys/types.h>
 #include <sys/ioctl.h>
 #include <sys/mtio.h>
 #include <sys/param.h>
 #include <assert.h>
 
+#include "config.h"
+#include "rmtlib.h"
+#include "swap.h"
+
+
 /*
  * uses old_mtget IRIX structure since we don't bother
  * sending the "V" version command.
diff --git a/librmt/rmtlib.h b/librmt/rmtlib.h
index bc6961c..1f877ca 100644
--- a/librmt/rmtlib.h
+++ b/librmt/rmtlib.h
@@ -27,9 +27,6 @@
  *
  */
 
-
-#include <xfs/xfs.h>
-
 /*
  *	Note that local vs remote file descriptors are distinquished
  *	by adding a bias to the remote descriptors.  This is a quick
diff --git a/librmt/rmtlseek.c b/librmt/rmtlseek.c
index 8903886..bf8c0fa 100644
--- a/librmt/rmtlseek.c
+++ b/librmt/rmtlseek.c
@@ -21,7 +21,9 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <stdio.h>
 #include <sys/types.h>
+#include <unistd.h>
 #include "rmtlib.h"
 
 static off_t _rmt_lseek(int, off_t, int);
diff --git a/librmt/rmtmsg.c b/librmt/rmtmsg.c
index 17addd1..d28a1f2 100644
--- a/librmt/rmtmsg.c
+++ b/librmt/rmtmsg.c
@@ -21,6 +21,11 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "config.h"
 #include "rmtlib.h"
 
 /*
diff --git a/librmt/rmtopen.c b/librmt/rmtopen.c
index 6a05ab3..4bf9383 100644
--- a/librmt/rmtopen.c
+++ b/librmt/rmtopen.c
@@ -24,13 +24,15 @@
 #include <unistd.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
 #include <sys/signal.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
-
+#include "config.h"
 #include "rmtlib.h"
 
 #define RMT_DEBUG_FILE "/tmp/librmt_debug" /* file for debug output on server */
diff --git a/librmt/rmtread.c b/librmt/rmtread.c
index d5a840e..3456901 100644
--- a/librmt/rmtread.c
+++ b/librmt/rmtread.c
@@ -21,6 +21,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <stdio.h>
+#include <unistd.h>
 #include <errno.h>
 
 #include "rmtlib.h"
diff --git a/librmt/rmtstatus.c b/librmt/rmtstatus.c
index 8528bc4..21d909d 100644
--- a/librmt/rmtstatus.c
+++ b/librmt/rmtstatus.c
@@ -21,6 +21,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <stdlib.h>
+#include <unistd.h>
 #include <errno.h>
 
 #include "rmtlib.h"
diff --git a/librmt/rmtwrite.c b/librmt/rmtwrite.c
index c42b1ab..9e5a1a3 100644
--- a/librmt/rmtwrite.c
+++ b/librmt/rmtwrite.c
@@ -21,6 +21,8 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <unistd.h>
+#include <stdio.h>
 #include <errno.h>
 
 #include "rmtlib.h"
diff --git a/restore/bag.c b/restore/bag.c
index 8c7a216..3927877 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -24,6 +24,8 @@
 #include <memory.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "bag.h"
diff --git a/restore/content.c b/restore/content.c
index 4796aea..b02e38a 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/mman.h>
@@ -35,6 +37,9 @@
 #include <malloc.h>
 #include <pthread.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "timeutil.h"
diff --git a/restore/dirattr.c b/restore/dirattr.c
index c829808..a15abe5 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -29,6 +29,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
@@ -37,6 +39,9 @@
 #include <fcntl.h>
 #include <dirent.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/restore/inomap.c b/restore/inomap.c
index 2c62afc..e5bcb55 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -19,6 +19,8 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <errno.h>
@@ -27,6 +29,9 @@
 #include <dirent.h>
 #include <time.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "util.h"
diff --git a/restore/namreg.c b/restore/namreg.c
index c64833d..18ba6d9 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -19,12 +19,17 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "lock.h"
diff --git a/restore/node.c b/restore/node.c
index f0297a5..046f2f6 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -19,12 +19,16 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/mman.h>
 #include <errno.h>
 #include <memory.h>
 #include <limits.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "win.h"
diff --git a/restore/tree.c b/restore/tree.c
index d377590..98f6952 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -19,7 +19,11 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 
+#include <unistd.h>
+#include <stdlib.h>
 #include <sys/mman.h>
+#include <sys/types.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
 #include <utime.h>
@@ -29,6 +33,9 @@
 #include <dirent.h>
 #include <sys/ioctl.h>
 #include <assert.h>
+#include <string.h>
+
+#include "config.h"
 
 #include "types.h"
 #include "exit.h"
diff --git a/restore/win.c b/restore/win.c
index a9f0239..3ca2af8 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -27,6 +27,8 @@
 #include <errno.h>
 #include <assert.h>
 
+#include "config.h"
+
 #include "types.h"
 #include "mlog.h"
 #include "qlock.h"
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/8] cleanup: kill intgen_t
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
  2015-10-16  1:44 ` [PATCH 1/8] cleanup: get rid of ASSERT Dave Chinner
  2015-10-16  1:44 ` [PATCH 2/8] build: don't rely on xfs/xfs.h to include necessary headers Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-16  1:44 ` [PATCH 4/8] cleanup: kill u_int*_t types Dave Chinner
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

intgen_t is for jdm (libhandle) interfaces, not as a random
substitute for "int". Do a global s/intgen_t/int across the codebase
with sed to remove this stupidity so that we don't have to include
xfs/jdm.h across almost the entire code base.

After a manual pass back over the callers of the jdm API, there are
no places where the return value needs to be an intgen_t. Indeed,
jdm_open passes back a file descriptor, so intgen_t by definition
cannot be anything other than an int.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/cldmgr.c         |  14 +--
 common/cldmgr.h         |   2 +-
 common/content.h        |   8 +-
 common/dlog.c           |   6 +-
 common/dlog.h           |   2 +-
 common/drive.c          |   6 +-
 common/drive.h          |  44 +++++-----
 common/drive_minrmt.c   | 222 +++++++++++++++++++++++------------------------
 common/drive_scsitape.c | 226 ++++++++++++++++++++++++------------------------
 common/drive_simple.c   |  84 +++++++++---------
 common/exit.h           |   2 +-
 common/fs.c             |  12 +--
 common/fs.h             |   8 +-
 common/global.c         |   4 +-
 common/global.h         |   2 +-
 common/inventory.c      |   4 +-
 common/inventory.h      |   2 +-
 common/main.c           |  76 ++++++++--------
 common/media.c          |   2 +-
 common/mlog.c           |  38 ++++----
 common/mlog.h           |  16 ++--
 common/openutil.c       |  28 +++---
 common/openutil.h       |  14 +--
 common/qlock.c          |  16 ++--
 common/ring.c           |   4 +-
 common/ring.h           |   4 +-
 common/stream.c         |  10 +--
 common/stream.h         |   6 +-
 common/types.h          |   6 +-
 common/util.c           |  66 +++++++-------
 common/util.h           |  42 ++++-----
 dump/content.c          | 106 +++++++++++------------
 dump/inomap.c           | 156 ++++++++++++++++-----------------
 dump/inomap.h           |   6 +-
 dump/var.c              |   4 +-
 inventory/inv_api.c     |   6 +-
 inventory/inv_core.c    |  14 +--
 inventory/inv_fstab.c   |   6 +-
 inventory/inv_idx.c     |  14 +--
 inventory/inv_mgr.c     |   8 +-
 inventory/inv_oref.c    |  30 +++----
 inventory/inv_oref.h    |  10 +--
 inventory/inv_priv.h    |  70 +++++++--------
 inventory/inv_stobj.c   |  20 ++---
 inventory/inventory.h   |   2 +-
 inventory/testmain.c    |   8 +-
 invutil/invidx.c        |   2 +-
 restore/content.c       | 132 ++++++++++++++--------------
 restore/dirattr.c       |  30 +++----
 restore/inomap.c        |  48 +++++-----
 restore/inomap.h        |   2 +-
 restore/namreg.c        |  10 +--
 restore/namreg.h        |   2 +-
 restore/node.c          |  14 +--
 restore/node.h          |   4 +-
 restore/tree.c          |  54 ++++++------
 restore/win.c           |   6 +-
 restore/win.h           |   4 +-
 58 files changed, 872 insertions(+), 872 deletions(-)

diff --git a/common/cldmgr.c b/common/cldmgr.c
index 88fd7fd..624da62 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -47,7 +47,7 @@ typedef enum { C_AVAIL, C_ALIVE, C_EXITED } state_t;
 
 struct cld {
 	state_t c_state;
-	intgen_t c_exit_code;
+	int c_exit_code;
 	pthread_t c_tid;
 	ix_t c_streamix;
 	int ( * c_entry )( void *arg1 );
@@ -82,7 +82,7 @@ cldmgr_create( int ( * entry )( void *arg1 ),
 	       void *arg1 )
 {
 	cld_t *cldp;
-	intgen_t rval;
+	int rval;
 
 	assert( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
 
@@ -128,17 +128,17 @@ cldmgr_stop( void )
 	cldmgr_stopflag = BOOL_TRUE;
 }
 
-intgen_t
+int
 cldmgr_join( void )
 {
 	cld_t *p = cld;
 	cld_t *ep = cld + sizeof( cld ) / sizeof( cld[ 0 ] );
-	intgen_t xc = EXIT_NORMAL;
+	int xc = EXIT_NORMAL;
 
 	lock();
 	for ( ; p < ep ; p++ ) {
 		if ( p->c_state == C_EXITED ) {
-			if ( ( intgen_t )( p->c_streamix ) >= 0 ) {
+			if ( ( int )( p->c_streamix ) >= 0 ) {
 				stream_dead( p->c_tid );
 			}
 			pthread_join( p->c_tid, NULL );
@@ -230,8 +230,8 @@ cldmgr_entry( void *arg1 )
 
 	pthread_cleanup_push( cldmgr_cleanup, arg1 );
 
-	if ( ( intgen_t )( cldp->c_streamix ) >= 0 ) {
-		stream_register( tid, ( intgen_t )cldp->c_streamix );
+	if ( ( int )( cldp->c_streamix ) >= 0 ) {
+		stream_register( tid, ( int )cldp->c_streamix );
 	}
 	mlog( MLOG_DEBUG | MLOG_PROC,
 	      "thread %lu created for stream %d\n",
diff --git a/common/cldmgr.h b/common/cldmgr.h
index 1df0c0c..c3384fa 100644
--- a/common/cldmgr.h
+++ b/common/cldmgr.h
@@ -44,7 +44,7 @@ extern void cldmgr_stop( void );
  * EXIT_FAULT if any threads requested a core dump, or another EXIT_*
  * value if any threads exited abnormally.
  */
-extern intgen_t cldmgr_join( void );
+extern int cldmgr_join( void );
 
 /* cldmgr_stop_requested - returns TRUE if the child should gracefully
  * terminate.
diff --git a/common/content.h b/common/content.h
index 03b72f0..763c09f 100644
--- a/common/content.h
+++ b/common/content.h
@@ -84,13 +84,13 @@ extern bool_t is_quota_file(ino_t ino);
 #endif /* DUMP */
 
 #ifdef DUMP
-extern bool_t content_init( intgen_t argc,
+extern bool_t content_init( int argc,
 			    char *argv[ ],
 			    global_hdr_t *gwhdrtemplatep );
 	/* prepares for multi-stream dump
 	 */
 
-extern intgen_t content_stream_dump( ix_t strmix );
+extern int content_stream_dump( ix_t strmix );
 	/* does stream dump
 	 */
 
@@ -98,11 +98,11 @@ extern intgen_t content_stream_dump( ix_t strmix );
 #ifdef RESTORE
 extern size_t perssz;
 
-extern bool_t content_init( intgen_t argc, char *argv[ ], size64_t vmsz );
+extern bool_t content_init( int argc, char *argv[ ], size64_t vmsz );
 	/* prepares for multi-thread restore
 	 */
 
-extern intgen_t content_stream_restore( ix_t thrdix );
+extern int content_stream_restore( ix_t thrdix );
 	/* does thread restore
 	 */
 
diff --git a/common/dlog.c b/common/dlog.c
index dac4e64..cb5c11a 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -58,7 +58,7 @@ static void dlog_string_query_print( void *ctxp, char *fmt, ... );
 bool_t
 dlog_init( int argc, char *argv[ ] )
 {
-	intgen_t c;
+	int c;
 
 	/* can only call once
 	 */
@@ -140,7 +140,7 @@ dlog_desist( void )
 	dlog_allowed_flag = BOOL_FALSE;
 }
 
-intgen_t
+int
 dlog_fd( void )
 {
 	return dlog_ttyfd;
@@ -385,7 +385,7 @@ promptinput( char *buf,
 {
 	va_list args;
 	time32_t now = time( NULL );
-	intgen_t nread = -1;
+	int nread = -1;
 	sigset_t orig_set;
 	char *bufp = buf;
 
diff --git a/common/dlog.h b/common/dlog.h
index bc17c41..31ed9c2 100644
--- a/common/dlog.h
+++ b/common/dlog.h
@@ -39,7 +39,7 @@ extern void dlog_desist( void );
 
 /* returns the dialog tty file descriptor. returns -1 if none
  */
-extern intgen_t dlog_fd( void );
+extern int dlog_fd( void );
 
 /* returns BOOL_TRUE if a dialog consumed the given signal
  */
diff --git a/common/drive.c b/common/drive.c
index afef147..9fb0bb7 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -87,7 +87,7 @@ static drive_strategy_t *strategypp[] = {
 bool_t
 drive_init1( int argc, char *argv[ ] )
 {
-	intgen_t c;
+	int c;
 	ix_t driveix;
 
 	/* sanity check asserts
@@ -202,7 +202,7 @@ drive_init1( int argc, char *argv[ ] )
 	 */
 	for ( driveix = 0 ; driveix < drivecnt ; driveix++ ) {
 		drive_t *drivep = drivepp[ driveix ];
-		intgen_t bestscore = 0 - INTGENMAX;
+		int bestscore = 0 - INTGENMAX;
 		ix_t six;
 		ix_t scnt = sizeof( strategypp ) / sizeof( strategypp[ 0 ] );
 		drive_strategy_t *bestsp = 0;
@@ -210,7 +210,7 @@ drive_init1( int argc, char *argv[ ] )
 
 		for ( six = 0 ; six < scnt ; six++ ) {
 			drive_strategy_t *sp = strategypp[ six ];
-			intgen_t score;
+			int score;
 			score = ( * sp->ds_match )( argc,
 						    argv,
 						    drivep );
diff --git a/common/drive.h b/common/drive.h
index f693976..b0efa4c 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -132,19 +132,19 @@ typedef struct drive_hdr drive_hdr_t;
 struct drive;			/* forward declaration */
 
 struct drive_strategy {
-	intgen_t ds_id;
+	int ds_id;
 		    /* strategy ID
 		     */
 	char *ds_description;
 		    /* a short char string describing strategy
 		     */
-	intgen_t ( * ds_match )( intgen_t argc,
+	int ( * ds_match )( int argc,
 				 char *argv[ ],
 				 struct drive *drivep );
 		    /* returns degree of match. drivep has been pre-allocated
 		     * and initialized with generic info.
 		     */
-	bool_t ( * ds_instantiate )( intgen_t argc,
+	bool_t ( * ds_instantiate )( int argc,
 				     char *argv[ ],
 				     struct drive *drivep );
 		    /* creates a drive manager instance, by filling in the
@@ -245,9 +245,9 @@ struct drive {
 	ix_t d_index;		/* e.g., 0, 1, 2, ... */
 	bool_t d_isnamedpipepr;	/* is a named pipe */
 	bool_t d_isunnamedpipepr;/* is an unnamed pipe */
-	intgen_t d_capabilities;/* see DRIVE_CAP_xxx below */
+	int d_capabilities;/* see DRIVE_CAP_xxx below */
 	off64_t d_cap_est;	/* capacity estimate in bytes; -1 if unknown */
-	intgen_t d_rate_est;	/* bytes per second; -1 if unknown */
+	int d_rate_est;	/* bytes per second; -1 if unknown */
 	drive_markrec_t *d_markrecheadp; /* linked list of mark records */
 	drive_markrec_t *d_markrectailp; /* yet to be committed */
 	off64_t d_recmarksep;	/* transfered from strategy on instantiation */
@@ -267,7 +267,7 @@ struct drive_ops {
 				 * by do_init. returns FALSE if session should
 				 * be aborted.
 				 */
-	intgen_t ( * do_begin_read )( drive_t *drivep );
+	int ( * do_begin_read )( drive_t *drivep );
 				/* prepares the drive manager for reading.
 				 * if the media is positioned at BOM or just
 				 * after a file mark, current media file is
@@ -309,7 +309,7 @@ struct drive_ops {
 	char * ( * do_read )( drive_t *drivep,
 			      size_t wanted_bufsz,
 			      size_t *actual_bufszp,
-			      intgen_t *statp );
+			      int *statp );
 				/* asks the drive manager for a buffered filled
 				 * with the next read stream data.
 				 * the actual buffer size supplied may
@@ -356,7 +356,7 @@ struct drive_ops {
 				 * call to do_read(). will be used in a later
 				 * session to seek to that position.
 				 */
-	intgen_t ( * do_seek_mark )( drive_t *drivep,
+	int ( * do_seek_mark )( drive_t *drivep,
 				     drive_mark_t *drivemarkp );
 				/* searches for the specified mark within the
 				 * current file. returns zero if the mark
@@ -367,7 +367,7 @@ struct drive_ops {
 				 *	CORRUPTION - encountered corrupt data;
 				 *	DEVICE - device error;
 				 */
-	intgen_t ( * do_next_mark )( drive_t *drivep );
+	int ( * do_next_mark )( drive_t *drivep );
 				/* if d_capabilities has DRIVE_CAP_NEXTMARK set,
 				 * drive has the capability to
 				 * seek forward to the next mark. returns
@@ -385,7 +385,7 @@ struct drive_ops {
 				 * will position the media at the next media
 				 * file.
 				 */
-	intgen_t ( * do_begin_write )( drive_t *drivep );
+	int ( * do_begin_write )( drive_t *drivep );
 				/* begins a write media file for writing.
 				 * asserts the media is positioned at BOM or
 				 * just after a file mark. write header will
@@ -443,7 +443,7 @@ struct drive_ops {
 				 * be larger or smaller than the wanted bufsz,
 				 * but will be at least 1 byte in length.
 				 */
-	intgen_t ( * do_write )( drive_t *drivep,
+	int ( * do_write )( drive_t *drivep,
 				 char *bufp,
 				 size_t bufsz );
 				/* asks the drive manager to write bufsz
@@ -481,7 +481,7 @@ struct drive_ops {
 				 * alignment will be maintained after the
 				 * initial alignment done using this info.
 				 */
-	intgen_t ( * do_end_write )( drive_t *drivep, off64_t *ncommittedp );
+	int ( * do_end_write )( drive_t *drivep, off64_t *ncommittedp );
 				/* terminates a media file write sequence.
 				 * flushes any buffered data not yet committed
 				 * to media, and calls callbacks for all marks
@@ -502,9 +502,9 @@ struct drive_ops {
 				 * an error, do_end_write will not do any
 				 * I/O, and will return 0.
 				 */
-	intgen_t ( * do_fsf )( drive_t *drivep,
-			      intgen_t count,
-			      intgen_t *statp );
+	int ( * do_fsf )( drive_t *drivep,
+			      int count,
+			      int *statp );
 				/* if d_capabilities has DRIVE_CAP_FSF set,
 				 * drive has the capability to
 				 * forward space count files. returns the
@@ -528,9 +528,9 @@ struct drive_ops {
 				 * behaves as if position is at most recent
 				 * file mark or BOT.
 				 */
-	intgen_t ( * do_bsf )( drive_t *drivep,
-			       intgen_t count,
-			       intgen_t *statp );
+	int ( * do_bsf )( drive_t *drivep,
+			       int count,
+			       int *statp );
 				/* if d_capabilities has DRIVE_CAP_BSF set,
 				 * drive has the capability to backward space
 				 * count files. returns the number of actual
@@ -554,26 +554,26 @@ struct drive_ops {
 				 *	BOM - hit beginning of recorded data;
 				 *	DEVICE - device error;
 				 */
-	intgen_t ( * do_rewind )( drive_t *drivep );
+	int ( * do_rewind )( drive_t *drivep );
 				/* if d_capabilities has DRIVE_CAP_REWIND set,
 				 * drive has the capability to
 				 * position at beginning of recorded data
 				 *	DEVICE - device error;
 				 */
-	intgen_t ( * do_erase )( drive_t *drivep );
+	int ( * do_erase )( drive_t *drivep );
 				/* if d_capabilities has DRIVE_CAP_ERASE set,
 				 * drive has the capability to
 				 * erase: all content of media object is
 				 * eradicated.
 				 *	DEVICE - device error;
 				 */
-	intgen_t ( * do_eject_media )( drive_t *drivep );
+	int ( * do_eject_media )( drive_t *drivep );
 				/* if d_capabilities has DRIVE_CAP_EJECT set,
 				 * drive has capability
 				 * to eject media, and will do so when called.
 				 *	DEVICE - device error;
 				 */
-	intgen_t ( * do_get_device_class )( drive_t *drivep );
+	int ( * do_get_device_class )( drive_t *drivep );
 				/* returns the media class of the device
 				 * (see below).
 				 */
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 51685dc..21eb09e 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -263,71 +263,71 @@ extern int rmtwrite( int, const void *, uint);
 
 /* strategy functions
  */
-static intgen_t ds_match( int, char *[], drive_t * );
-static intgen_t ds_instantiate( int, char *[], drive_t * );
+static int ds_match( int, char *[], drive_t * );
+static int ds_instantiate( int, char *[], drive_t * );
 
 /* manager operations
  */
 static bool_t do_init( drive_t * );
 static bool_t do_sync( drive_t * );
-static intgen_t do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, intgen_t * );
+static int do_begin_read( drive_t * );
+static char *do_read( drive_t *, size_t , size_t *, int * );
 static void do_return_read_buf( drive_t *, char *, size_t );
 static void do_get_mark( drive_t *, drive_mark_t * );
-static intgen_t do_seek_mark( drive_t *, drive_mark_t * );
-static intgen_t do_next_mark( drive_t * );
+static int do_seek_mark( drive_t *, drive_mark_t * );
+static int do_next_mark( drive_t * );
 static void do_get_mark( drive_t *, drive_mark_t * );
 static void do_end_read( drive_t * );
-static intgen_t do_begin_write( drive_t * );
+static int do_begin_write( drive_t * );
 static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
 static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static intgen_t do_write( drive_t *, char *, size_t );
+static int do_write( drive_t *, char *, size_t );
 static size_t do_get_align_cnt( drive_t * );
-static intgen_t do_end_write( drive_t *, off64_t * );
-static intgen_t do_fsf( drive_t *, intgen_t , intgen_t *);
-static intgen_t do_bsf( drive_t *, intgen_t , intgen_t *);
-static intgen_t do_rewind( drive_t * );
-static intgen_t do_erase( drive_t * );
-static intgen_t do_eject_media( drive_t * );
-static intgen_t do_get_device_class( drive_t * );
+static int do_end_write( drive_t *, off64_t * );
+static int do_fsf( drive_t *, int , int *);
+static int do_bsf( drive_t *, int , int *);
+static int do_rewind( drive_t * );
+static int do_erase( drive_t * );
+static int do_eject_media( drive_t * );
+static int do_get_device_class( drive_t * );
 static void do_display_metrics( drive_t *drivep );
 static void do_quit( drive_t * );
 
 /* misc. local utility funcs
  */
-static intgen_t	mt_op(intgen_t , intgen_t , intgen_t );
-static intgen_t determine_write_error( int, int );
-static intgen_t read_label( drive_t *);
+static int	mt_op(int , int , int );
+static int determine_write_error( int, int );
+static int read_label( drive_t *);
 static bool_t tape_rec_checksum_check( drive_context_t *, char * );
 static void set_recommended_sizes( drive_t * );
 static void display_access_failed_message( drive_t *);
 static bool_t get_tpcaps( drive_t * );
-static intgen_t prepare_drive( drive_t *drivep );
+static int prepare_drive( drive_t *drivep );
 static bool_t Open( drive_t *drivep );
 static void Close( drive_t *drivep );
-static intgen_t Read( drive_t *drivep,
+static int Read( drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      intgen_t *errnop );
-static intgen_t Write( drive_t *drivep,
+		      int *errnop );
+static int Write( drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       intgen_t *saved_errnop );
-static intgen_t record_hdr_validate( drive_t *drivep,
+		       int *saved_errnop );
+static int record_hdr_validate( drive_t *drivep,
 				     char *bufp,
 				     bool_t chkoffpr );
 static int ring_read( void *clientctxp, char *bufp );
 static int ring_write( void *clientctxp, char *bufp );
 static double percent64( off64_t num, off64_t denom );
-static intgen_t getrec( drive_t *drivep );
-static intgen_t write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
+static int getrec( drive_t *drivep );
+static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
                               bool_t xlatepr );
 static ring_msg_t * Ring_get( ring_t *ringp );
 static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
 static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static intgen_t validate_media_file_hdr( drive_t *drivep );
+static int validate_media_file_hdr( drive_t *drivep );
 static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, intgen_t mlog_flags );
+static void display_ring_metrics( drive_t *drivep, int mlog_flags );
 #ifdef CLRMTAUD
 static u_int32_t rewind_and_verify( drive_t *drivep );
 static u_int32_t erase_and_verify( drive_t *drivep ); 
@@ -409,11 +409,11 @@ static u_int32_t cmdlineblksize = 0;
 /* strategy match - determines if this is the right strategy
  */
 /* ARGSUSED */
-static intgen_t
+static int
 ds_match( int argc, char *argv[], drive_t *drivep )
 {
-	intgen_t fd;
-	intgen_t c;
+	int fd;
+	int c;
 	bool_t minrmt = BOOL_FALSE;
 
 	/* heuristics to determine if this is a drive.
@@ -473,7 +473,7 @@ static bool_t
 ds_instantiate( int argc, char *argv[], drive_t *drivep )
 {
 	drive_context_t *contextp;
-	intgen_t c;
+	int c;
 
 	/* opportunity for sanity checking
 	 */
@@ -591,7 +591,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
 		assert( contextp->dc_bufp );
 	} else {
-		intgen_t rval;
+		int rval;
 		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
 		      contextp->dc_ringlen );
@@ -712,11 +712,11 @@ do_sync( drive_t *drivep )
  *	DRIVE_ERROR_* on failure
  *
  */
-static intgen_t
+static int
 do_begin_read( drive_t *drivep )
 {
         drive_context_t *contextp;
-        intgen_t rval;
+        int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: begin read\n" );
@@ -812,12 +812,12 @@ static char *
 do_read( drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 intgen_t *rvalp )
+	 int *rvalp )
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: read: wanted %u (0x%x)\n",
@@ -970,7 +970,7 @@ typedef enum { SEEKMODE_BUF, SEEKMODE_RAW } seekmode_t;
  *	DRIVE_ERROR_* on failure
  *
  */
-static intgen_t
+static int
 do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 {
 	drive_context_t	*contextp;
@@ -1036,7 +1036,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			size_t wantedcnt;
 			char *dummybufp;
 			size_t actualcnt;
-			intgen_t rval;
+			int rval;
 
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
@@ -1147,15 +1147,15 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
 			while ( recskipcnt64remaining ) {
-				intgen_t recskipcnt;
-				intgen_t saved_errno;
-				intgen_t rval;
+				int recskipcnt;
+				int saved_errno;
+				int rval;
 
 				assert( recskipcnt64remaining > 0 );
 				if ( recskipcnt64remaining > INTGENMAX ) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( intgen_t )
+					recskipcnt = ( int )
 						     recskipcnt64remaining;
 				}
 				assert( recskipcnt > 0 );
@@ -1194,7 +1194,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
-		intgen_t rval;
+		int rval;
 
 		assert( ! contextp->dc_recp );
 
@@ -1253,7 +1253,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		/* eat that much tape
 		 */
 		if ( wantedcnt > 0 ) {
-		    intgen_t rval;
+		    int rval;
 		    rval = 0;
 		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
 		    if ( rval ) {
@@ -1300,7 +1300,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  *	0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_next_mark( drive_t *drivep )
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
@@ -1308,11 +1308,11 @@ do_next_mark( drive_t *drivep )
 	char *p;
 	ix_t trycnt;
 	const ix_t maxtrycnt = 5;
-	intgen_t nread;
+	int nread;
 	off64_t markoff;
-	intgen_t saved_errno;
+	int saved_errno;
 	size_t tailsz;
-	intgen_t rval;
+	int rval;
 
 	/* assert protocol being followed.
 	 */
@@ -1418,7 +1418,7 @@ readrecord:
 	goto validateread;
 
 validateread:
-	if ( nread == ( intgen_t )tape_recsz ) {
+	if ( nread == ( int )tape_recsz ) {
 		goto validatehdr;
 	}
 
@@ -1585,7 +1585,7 @@ do_end_read( drive_t *drivep )
  *	0 on success
  * 	DRIVE_ERROR_... on failure
  */
-static intgen_t
+static int
 do_begin_write( drive_t *drivep )
 {
 	drive_context_t		*contextp;
@@ -1593,7 +1593,7 @@ do_begin_write( drive_t *drivep )
 	global_hdr_t		*gwhdrp;
 	rec_hdr_t		*tpwhdrp;
 	rec_hdr_t		*rechdrp;
-	intgen_t		rval;
+	int		rval;
 	media_hdr_t		*mwhdrp;
 	content_hdr_t		*ch;
 	content_inode_hdr_t	*cih;
@@ -1842,7 +1842,7 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
  *	non 0 on error
  */
 /* ARGSUSED */
-static intgen_t
+static int
 do_write( drive_t *drivep, char *bufp, size_t retcnt )
 {
 	drive_context_t *contextp;
@@ -1850,7 +1850,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	global_hdr_t *gwhdrp;
 	size_t heldcnt;
 	off64_t last_rec_wrtn_wo_err; /* zero-based index */
-	intgen_t rval;
+	int rval;
 
 	/* get drive context and pointer to global write hdr
 	 */
@@ -2015,7 +2015,7 @@ do_get_align_cnt( drive_t * drivep )
  *	 0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_end_write( drive_t *drivep, off64_t *ncommittedp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -2024,7 +2024,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	off64_t recs_guaranteed;
 	off64_t bytes_committed;
 
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: end write\n" );
@@ -2160,7 +2160,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * exposing any write errors.
 	 */
 	if ( ! rval ) {
-		intgen_t weofrval;
+		int weofrval;
 
 		weofrval = mt_op( contextp->dc_fd, MTWEOF, 1 );
 		if ( weofrval ) {
@@ -2211,8 +2211,8 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
  *	number of media files skipped
  *	*statp set to zero or DRIVE_ERROR_...
  */
-static intgen_t
-do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
+static int
+do_fsf( drive_t *drivep, int count, int *statp )
 {
 	int 		i, done, op_failed, opcount;
 	drive_context_t *contextp;
@@ -2287,14 +2287,14 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
  *	number of media files skipped
  *	*statp set to zero or DRIVE_ERROR_...
  */
-static intgen_t
-do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
+static int
+do_bsf( drive_t *drivep, int count, int *statp )
 {
 #ifdef DEBUG
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 #endif
-	intgen_t skipped;
-	intgen_t rval;
+	int skipped;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "rmt drive op: bsf: count %d\n",
@@ -2375,7 +2375,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
  *	0 on sucess
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_rewind( drive_t *drivep )
 {
 #ifdef DEBUG
@@ -2401,7 +2401,7 @@ do_rewind( drive_t *drivep )
  *	0 on sucess
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_erase( drive_t *drivep )
 {
 #ifdef DEBUG
@@ -2439,7 +2439,7 @@ do_erase( drive_t *drivep )
  *	0 on sucess
  *	DRIVE_ERROR_DEVICE on failure
  */
-static intgen_t
+static int
 do_eject_media( drive_t *drivep )
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
@@ -2472,7 +2472,7 @@ do_eject_media( drive_t *drivep )
  *	always returns DEVICE_TAPE_REMOVABLE
  */
 /* ARGSUSED */
-static intgen_t
+static int
 do_get_device_class( drive_t *drivep)
 {
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
@@ -2547,13 +2547,13 @@ percent64( off64_t num, off64_t denom )
  *	0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 read_label( drive_t *drivep )
 {
 	drive_context_t *contextp;
-	intgen_t nread;
-	intgen_t saved_errno;
-	intgen_t rval;
+	int nread;
+	int saved_errno;
+	int rval;
 
 	/* initialize context ptr
 	 */
@@ -2568,8 +2568,8 @@ read_label( drive_t *drivep )
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( intgen_t )tape_recsz ) {
-		assert( nread < ( intgen_t )tape_recsz );
+	if ( nread != ( int )tape_recsz ) {
+		assert( nread < ( int )tape_recsz );
 	} 
 
 	/* check for an unexpected errno
@@ -2613,7 +2613,7 @@ read_label( drive_t *drivep )
 	return rval;
 }
 
-static intgen_t
+static int
 validate_media_file_hdr( drive_t *drivep )
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
@@ -2792,12 +2792,12 @@ set_recommended_sizes( drive_t *drivep )
  *	0 on sucess
  *	-1 on failure
  */
-static intgen_t
-mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
+static int
+mt_op(int fd, int sub_op, int param )
 {
 	struct mtop 	mop;
 	char *printstr;
-	intgen_t rval;
+	int rval;
 
 	mop.mt_op   	= (short )sub_op;
 	mop.mt_count	= param;
@@ -2874,10 +2874,10 @@ mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
  * RETURNS:
  *      DRIVE_ERROR_*
  */
-static intgen_t
+static int
 determine_write_error( int nwritten, int saved_errno )
 {
-	intgen_t        ret = 0;
+	int        ret = 0;
 
 	if ( saved_errno == EACCES ) {
 		mlog(MLOG_NORMAL,
@@ -3059,7 +3059,7 @@ display_access_failed_message( drive_t *drivep )
  * determines other drive attributes. determines if any previous
  * xfsdumps on media.
  */
-static intgen_t
+static int
 prepare_drive( drive_t *drivep )
 {
 	drive_context_t	*contextp;
@@ -3067,7 +3067,7 @@ prepare_drive( drive_t *drivep )
 	ix_t try;
 	ix_t maxtries;
 	bool_t changedblkszpr;
-	intgen_t rval;
+	int rval;
 
 	/* get pointer to drive context
 	 */
@@ -3159,8 +3159,8 @@ prepare_drive( drive_t *drivep )
 	changedblkszpr = BOOL_FALSE;
 
 	for ( try = 1 ; ; try++ ) {
-		intgen_t nread;
-		intgen_t saved_errno;
+		int nread;
+		int saved_errno;
 
 		if ( cldmgr_stop_requested( )) {
 			return DRIVE_ERROR_STOP;
@@ -3264,7 +3264,7 @@ prepare_drive( drive_t *drivep )
 #endif
 		}
 
-		if ( nread == ( intgen_t )tape_recsz ) {
+		if ( nread == ( int )tape_recsz ) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			  "nread == selected blocksize "
 			  "indicates correct blocksize found\n" );
@@ -3272,7 +3272,7 @@ prepare_drive( drive_t *drivep )
 		}
 
 		/* short read */
-		if (( saved_errno == 0 ) && ( nread < (intgen_t)tape_recsz)) {
+		if (( saved_errno == 0 ) && ( nread < (int)tape_recsz)) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			  "nread < selected blocksize "
 			  "indicates incorrect blocksize found "
@@ -3404,7 +3404,7 @@ static bool_t
 Open( drive_t *drivep )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t oflags;
+	int oflags;
 
 #ifdef DUMP
 	oflags = O_RDWR;
@@ -3443,11 +3443,11 @@ Close( drive_t *drivep )
 	contextp->dc_fd = -1;
 }
 
-static intgen_t
-Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
+static int
+Read( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nread;
+	int nread;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: reading %u bytes\n",
@@ -3465,7 +3465,7 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 		      cnt,
 		      errno,
 		      strerror( errno ));
-	} else if ( nread != ( intgen_t )cnt ) {
+	} else if ( nread != ( int )cnt ) {
 		mlog( MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes short: nread == %d\n",
 		      cnt,
@@ -3479,11 +3479,11 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	return nread;
 }
 
-static intgen_t
-Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
+static int
+Write( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nwritten;
+	int nwritten;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: writing %u bytes\n",
@@ -3501,7 +3501,7 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 		      cnt,
 		      errno,
 		      strerror( errno ));
-	} else if ( nwritten != ( intgen_t )cnt ) {
+	} else if ( nwritten != ( int )cnt ) {
 		mlog( MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes short: nwritten == %d\n",
 		      cnt,
@@ -3518,7 +3518,7 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 /* validate a record header, log any anomolies, and return appropriate
  * indication.
  */
-static intgen_t
+static int
 record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -3617,17 +3617,17 @@ record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
 /* do a read, determine DRIVE_ERROR_... if failure, and return failure code.
  * return 0 on success.
  */
-static intgen_t
+static int
 read_record(  drive_t *drivep, char *bufp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nread;
-	intgen_t saved_errno;
-	intgen_t rval;
+	int nread;
+	int saved_errno;
+	int rval;
 
 	nread = Read( drivep, bufp, tape_recsz, &saved_errno );
 
-	if ( nread == ( intgen_t )tape_recsz ) {
+	if ( nread == ( int )tape_recsz ) {
 		contextp->dc_iocnt++;
 		rval = record_hdr_validate( drivep, bufp, BOOL_TRUE );
 		return rval;
@@ -3670,7 +3670,7 @@ read_record(  drive_t *drivep, char *bufp )
 	/* short read
 	 */
 	if ( nread >= 0 ) {
-		assert( nread <= ( intgen_t )tape_recsz );
+		assert( nread <= ( int )tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
@@ -3698,7 +3698,7 @@ ring_read( void *clientctxp, char *bufp )
 
 /* gets another record IF dc_recp is NULL
  */
-static intgen_t
+static int
 getrec( drive_t *drivep )
 {
 	drive_context_t *contextp;
@@ -3707,7 +3707,7 @@ getrec( drive_t *drivep )
 	while ( ! contextp->dc_recp ) {
 		rec_hdr_t *rechdrp;
 		if ( contextp->dc_singlethreadedpr ) {
-			intgen_t rval;
+			int rval;
 			contextp->dc_recp = contextp->dc_bufp;
 			rval = read_record( drivep, contextp->dc_recp );
 			if ( rval ) {
@@ -3755,13 +3755,13 @@ getrec( drive_t *drivep )
  * return 0 on success.
  */
 /*ARGSUSED*/
-static intgen_t
+static int
 write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nwritten;
-	intgen_t saved_errno;
-	intgen_t rval;
+	int nwritten;
+	int saved_errno;
+	int rval;
 
         if ( xlatepr ) {
 		rec_hdr_t rechdr;
@@ -3775,7 +3775,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 
 	nwritten = Write( drivep, bufp, tape_recsz, &saved_errno );
 
-	if ( nwritten == ( intgen_t )tape_recsz ) {
+	if ( nwritten == ( int )tape_recsz ) {
 		contextp->dc_iocnt++;
 		return 0;
 	}
@@ -3843,7 +3843,7 @@ calc_max_lost( drive_t *drivep )
 }
 
 static void
-display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
+display_ring_metrics( drive_t *drivep, int mlog_flags )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
@@ -3894,7 +3894,7 @@ rewind_and_verify( drive_t *drivep )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	ix_t try;
-	intgen_t rval;
+	int rval;
 
 	rval = mt_op( contextp->dc_fd, MTREW, 0 );
 	for ( try = 1 ; ; try++ ) {
@@ -3920,7 +3920,7 @@ static short
 erase_and_verify( drive_t *drivep ) 
 {
 	char *tempbufp;
-	intgen_t saved_errno;
+	int saved_errno;
 
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index eade6ac..605675f 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -305,79 +305,79 @@ extern int rmtwrite( int, const void *, uint);
 
 /* strategy functions
  */
-static intgen_t ds_match( int, char *[], drive_t * );
-static intgen_t ds_instantiate( int, char *[], drive_t * );
+static int ds_match( int, char *[], drive_t * );
+static int ds_instantiate( int, char *[], drive_t * );
 
 /* manager operations
  */
 static bool_t do_init( drive_t * );
 static bool_t do_sync( drive_t * );
-static intgen_t do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, intgen_t * );
+static int do_begin_read( drive_t * );
+static char *do_read( drive_t *, size_t , size_t *, int * );
 static void do_return_read_buf( drive_t *, char *, size_t );
 static void do_get_mark( drive_t *, drive_mark_t * );
-static intgen_t do_seek_mark( drive_t *, drive_mark_t * );
-static intgen_t do_next_mark( drive_t * );
+static int do_seek_mark( drive_t *, drive_mark_t * );
+static int do_next_mark( drive_t * );
 static void do_get_mark( drive_t *, drive_mark_t * );
 static void do_end_read( drive_t * );
-static intgen_t do_begin_write( drive_t * );
+static int do_begin_write( drive_t * );
 static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
 static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static intgen_t do_write( drive_t *, char *, size_t );
+static int do_write( drive_t *, char *, size_t );
 static size_t do_get_align_cnt( drive_t * );
-static intgen_t do_end_write( drive_t *, off64_t * );
-static intgen_t do_fsf( drive_t *, intgen_t , intgen_t *);
-static intgen_t do_bsf( drive_t *, intgen_t , intgen_t *);
-static intgen_t do_rewind( drive_t * );
-static intgen_t do_erase( drive_t * );
-static intgen_t do_eject_media( drive_t * );
-static intgen_t do_get_device_class( drive_t * );
+static int do_end_write( drive_t *, off64_t * );
+static int do_fsf( drive_t *, int , int *);
+static int do_bsf( drive_t *, int , int *);
+static int do_rewind( drive_t * );
+static int do_erase( drive_t * );
+static int do_eject_media( drive_t * );
+static int do_get_device_class( drive_t * );
 static void do_display_metrics( drive_t *drivep );
 static void do_quit( drive_t * );
 
 /* misc. local utility funcs
  */
-static intgen_t	mt_op(intgen_t , intgen_t , intgen_t );
-static intgen_t mt_blkinfo(intgen_t , struct mtblkinfo * );
+static int	mt_op(int , int , int );
+static int mt_blkinfo(int , struct mtblkinfo * );
 static bool_t mt_get_fileno( drive_t *, long *);
 static bool_t mt_get_status( drive_t *, mtstat_t *);
-static intgen_t determine_write_error( drive_t *, int, int );
-static intgen_t read_label( drive_t *);
+static int determine_write_error( drive_t *, int, int );
+static int read_label( drive_t *);
 static bool_t tape_rec_checksum_check( drive_context_t *, char * );
 static void set_recommended_sizes( drive_t * );
 static void display_access_failed_message( drive_t *);
 static void status_failed_message( drive_t *);
 static bool_t get_tpcaps( drive_t * );
 static bool_t set_fixed_blksz( drive_t *, size_t );
-static intgen_t prepare_drive( drive_t *drivep );
+static int prepare_drive( drive_t *drivep );
 static bool_t Open( drive_t *drivep );
 static void Close( drive_t *drivep );
-static intgen_t Read( drive_t *drivep,
+static int Read( drive_t *drivep,
 		      char *bufp,
 		      size_t cnt,
-		      intgen_t *errnop );
-static intgen_t Write( drive_t *drivep,
+		      int *errnop );
+static int Write( drive_t *drivep,
 		       char *bufp,
 		       size_t cnt,
-		       intgen_t *saved_errnop );
-static intgen_t quick_backup( drive_t *drivep,
+		       int *saved_errnop );
+static int quick_backup( drive_t *drivep,
 			      drive_context_t *contextp,
 			      ix_t skipcnt );
-static intgen_t record_hdr_validate( drive_t *drivep,
+static int record_hdr_validate( drive_t *drivep,
 				     char *bufp,
 				     bool_t chkoffpr );
 static int ring_read( void *clientctxp, char *bufp );
 static int ring_write( void *clientctxp, char *bufp );
 static double percent64( off64_t num, off64_t denom );
-static intgen_t getrec( drive_t *drivep );
-static intgen_t write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
+static int getrec( drive_t *drivep );
+static int write_record( drive_t *drivep, char *bufp, bool_t chksumpr,
                               bool_t xlatepr );
 static ring_msg_t * Ring_get( ring_t *ringp );
 static void Ring_reset(  ring_t *ringp, ring_msg_t *msgp );
 static void Ring_put(  ring_t *ringp, ring_msg_t *msgp );
-static intgen_t validate_media_file_hdr( drive_t *drivep );
+static int validate_media_file_hdr( drive_t *drivep );
 static void calc_max_lost( drive_t *drivep );
-static void display_ring_metrics( drive_t *drivep, intgen_t mlog_flags );
+static void display_ring_metrics( drive_t *drivep, int mlog_flags );
 static mtstat_t rewind_and_verify( drive_t *drivep );
 static mtstat_t erase_and_verify( drive_t *drivep );
 static mtstat_t bsf_and_verify( drive_t *drivep );
@@ -511,11 +511,11 @@ is_scsi_driver(char *pathname)
 /* strategy match - determines if this is the right strategy
  */
 /* ARGSUSED */
-static intgen_t
+static int
 ds_match( int argc, char *argv[], drive_t *drivep )
 {
 	struct mtget mt_stat;
-	intgen_t fd;
+	int fd;
 
 	/* heuristics to determine if this is a drive.
 	 */
@@ -553,7 +553,7 @@ static bool_t
 ds_instantiate( int argc, char *argv[], drive_t *drivep )
 {
 	drive_context_t *contextp;
-	intgen_t c;
+	int c;
 
 	/* opportunity for sanity checking
 	 */
@@ -681,7 +681,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
 		assert( contextp->dc_bufp );
 	} else {
-		intgen_t rval;
+		int rval;
 		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
 		      "ring op: create: ringlen == %u\n",
 		      contextp->dc_ringlen );
@@ -825,11 +825,11 @@ do_sync( drive_t *drivep )
  *	DRIVE_ERROR_* on failure
  *
  */
-static intgen_t
+static int
 do_begin_read( drive_t *drivep )
 {
         drive_context_t *contextp;
-        intgen_t rval;
+        int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: begin read\n" );
@@ -925,12 +925,12 @@ static char *
 do_read( drive_t *drivep,
 	 size_t wantedcnt,
 	 size_t *actualcntp,
-	 intgen_t *rvalp )
+	 int *rvalp )
 {
 	drive_context_t *contextp;
 	size_t availcnt;
 	size_t actualcnt;
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: read: wanted %u (0x%x)\n",
@@ -1083,7 +1083,7 @@ typedef enum { SEEKMODE_BUF, SEEKMODE_RAW } seekmode_t;
  *	DRIVE_ERROR_* on failure
  *
  */
-static intgen_t
+static int
 do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 {
 	drive_context_t	*contextp;
@@ -1149,7 +1149,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			size_t wantedcnt;
 			char *dummybufp;
 			size_t actualcnt;
-			intgen_t rval;
+			int rval;
 
 			/* if this is the last record, the wanted offset
 			 * must be just after it.
@@ -1260,15 +1260,15 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
 			recskipcnt64remaining = recskipcnt64;
 			while ( recskipcnt64remaining ) {
-				intgen_t recskipcnt;
-				intgen_t saved_errno;
-				intgen_t rval;
+				int recskipcnt;
+				int saved_errno;
+				int rval;
 
 				assert( recskipcnt64remaining > 0 );
 				if ( recskipcnt64remaining > INTGENMAX ) {
 					recskipcnt = INTGENMAX;
 				} else {
-					recskipcnt = ( intgen_t )
+					recskipcnt = ( int )
 						     recskipcnt64remaining;
 				}
 				assert( recskipcnt > 0 );
@@ -1307,7 +1307,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		size_t wantedcnt;
 		char *dummybufp;
 		size_t actualcnt;
-		intgen_t rval;
+		int rval;
 
 		assert( ! contextp->dc_recp );
 
@@ -1366,7 +1366,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		/* eat that much tape
 		 */
 		if ( wantedcnt > 0 ) {
-		    intgen_t rval;
+		    int rval;
 		    rval = 0;
 		    dummybufp = do_read( drivep, wantedcnt, &actualcnt, &rval );
 		    if ( rval ) {
@@ -1413,7 +1413,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  *	0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_next_mark( drive_t *drivep )
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
@@ -1421,12 +1421,12 @@ do_next_mark( drive_t *drivep )
 	char *p;
 	ix_t trycnt;
 	const ix_t maxtrycnt = 5;
-	intgen_t nread;
+	int nread;
 	off64_t markoff;
-	intgen_t saved_errno;
+	int saved_errno;
 	mtstat_t mtstat;
 	size_t tailsz;
-	intgen_t rval;
+	int rval;
 	bool_t ok;
 
 	/* assert protocol being followed.
@@ -1533,7 +1533,7 @@ readrecord:
 	goto validateread;
 
 validateread:
-	if ( nread == ( intgen_t )tape_recsz ) {
+	if ( nread == ( int )tape_recsz ) {
 		goto validatehdr;
 	}
 	ok = mt_get_status( drivep, &mtstat );
@@ -1721,7 +1721,7 @@ do_end_read( drive_t *drivep )
  *	0 on success
  * 	DRIVE_ERROR_... on failure
  */
-static intgen_t
+static int
 do_begin_write( drive_t *drivep )
 {
 	drive_context_t		*contextp;
@@ -1730,7 +1730,7 @@ do_begin_write( drive_t *drivep )
 	rec_hdr_t		*tpwhdrp;
 	rec_hdr_t		*rechdrp;
 	mtstat_t		mtstat;
-	intgen_t		rval;
+	int		rval;
 	media_hdr_t		*mwhdrp;
 	content_hdr_t		*ch;
 	content_inode_hdr_t	*cih;
@@ -1992,7 +1992,7 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
  *	non 0 on error
  */
 /* ARGSUSED */
-static intgen_t
+static int
 do_write( drive_t *drivep, char *bufp, size_t retcnt )
 {
 	drive_context_t *contextp;
@@ -2000,7 +2000,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
 	global_hdr_t *gwhdrp;
 	size_t heldcnt;
 	off64_t last_rec_wrtn_wo_err; /* zero-based index */
-	intgen_t rval;
+	int rval;
 
 	/* get drive context and pointer to global write hdr
 	 */
@@ -2165,7 +2165,7 @@ do_get_align_cnt( drive_t * drivep )
  *	 0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_end_write( drive_t *drivep, off64_t *ncommittedp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -2174,7 +2174,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	off64_t recs_guaranteed;
 	off64_t bytes_committed;
 
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "drive op: end write\n" );
@@ -2310,7 +2310,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 	 * exposing any write errors.
 	 */
 	if ( ! rval ) {
-		intgen_t weofrval;
+		int weofrval;
 		mtstat_t mtstat;
 		bool_t ok;
 
@@ -2375,8 +2375,8 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
  *	number of media files skipped
  *	*statp set to zero or DRIVE_ERROR_...
  */
-static intgen_t
-do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
+static int
+do_fsf( drive_t *drivep, int count, int *statp )
 {
 	int 		i, done, op_failed, opcount;
 	mtstat_t mtstat;
@@ -2475,13 +2475,13 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
  *	number of media files skipped
  *	*statp set to zero or DRIVE_ERROR_...
  */
-static intgen_t
-do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
+static int
+do_bsf( drive_t *drivep, int count, int *statp )
 {
 #ifdef DEBUG
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 #endif
-	intgen_t skipped;
+	int skipped;
 	mtstat_t mtstat;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
@@ -2601,7 +2601,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
  *	0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_rewind( drive_t *drivep )
 {
 #ifdef DEBUG
@@ -2632,7 +2632,7 @@ do_rewind( drive_t *drivep )
  *	0 on success
  *	DRIVE_ERROR_* on failure
  */
-static intgen_t
+static int
 do_erase( drive_t *drivep )
 {
 #ifdef DEBUG
@@ -2677,7 +2677,7 @@ do_erase( drive_t *drivep )
  *	0 on success
  *	DRIVE_ERROR_DEVICE on failure
  */
-static intgen_t
+static int
 do_eject_media( drive_t *drivep )
 {
 	drive_context_t	*contextp = (drive_context_t *)drivep->d_contextp;
@@ -2710,7 +2710,7 @@ do_eject_media( drive_t *drivep )
  *	always returns DEVICE_TAPE_REMOVABLE
  */
 /* ARGSUSED */
-static intgen_t
+static int
 do_get_device_class( drive_t *drivep)
 {
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
@@ -2832,15 +2832,15 @@ percent64( off64_t num, off64_t denom )
  */  
 
 
-static intgen_t
+static int
 read_label( drive_t *drivep )
 {
 	drive_context_t *contextp;
-	intgen_t nread;
-	intgen_t saved_errno;
+	int nread;
+	int saved_errno;
 	mtstat_t mtstat;
 	bool_t wasatbotpr;
-	intgen_t rval;
+	int rval;
 	bool_t ok;
 
 	/* initialize context ptr
@@ -2918,8 +2918,8 @@ read_label( drive_t *drivep )
 
 	/* if a read error, get status
 	 */
-	if ( nread != ( intgen_t )tape_recsz ) {
-		assert( nread < ( intgen_t )tape_recsz );
+	if ( nread != ( int )tape_recsz ) {
+		assert( nread < ( int )tape_recsz );
 		ok = mt_get_status( drivep, &mtstat );
 		if ( ! ok ) {
 			status_failed_message( drivep );
@@ -3008,7 +3008,7 @@ read_label( drive_t *drivep )
 	return rval;
 }
 
-static intgen_t
+static int
 validate_media_file_hdr( drive_t *drivep )
 {
 	global_hdr_t		*grhdrp = drivep->d_greadhdrp;
@@ -3169,7 +3169,7 @@ set_fixed_blksz( drive_t *drivep, size_t blksz )
                  */
                 if ( mt_op( contextp->dc_fd,
                             MTSETBLK,  
-                            ( intgen_t )blksz ) ) {
+                            ( int )blksz ) ) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
 			      "MTSETBLK %u failed: %s (%d)\n",
 			      blksz,
@@ -3328,7 +3328,7 @@ set_recommended_sizes( drive_t *drivep )
  *	FALSE on failure
  */
 static bool_t
-mt_blkinfo( intgen_t fd, struct mtblkinfo *minfo )
+mt_blkinfo( int fd, struct mtblkinfo *minfo )
 {
 	struct mtget 	mt_stat;
 
@@ -3382,12 +3382,12 @@ mt_blkinfo( intgen_t fd, struct mtblkinfo *minfo )
  *	0 on success
  *	-1 on failure
  */
-static intgen_t
-mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
+static int
+mt_op(int fd, int sub_op, int param )
 {
 	struct mtop 	mop;
 	char *printstr;
-	intgen_t rval;
+	int rval;
 
 	mop.mt_op   	= (short )sub_op;
 	mop.mt_count	= param;
@@ -3554,11 +3554,11 @@ mt_get_status( drive_t *drivep, long *status)
  * RETURNS:
  *	DRIVE_ERROR_*
  */
-static intgen_t
+static int
 determine_write_error( drive_t *drivep, int nwritten, int saved_errno )
 {
 	mtstat_t	mtstat;
-	intgen_t 	ret;
+	int 	ret;
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 
 	/* get tape device status
@@ -3847,7 +3847,7 @@ is_variable( drive_t *drivep, bool_t *varblk )
  * determines other drive attributes. determines if any previous
  * xfsdumps on media.
  */
-static intgen_t
+static int
 prepare_drive( drive_t *drivep )
 {
 	drive_context_t	*contextp;
@@ -3856,7 +3856,7 @@ prepare_drive( drive_t *drivep )
 	ix_t try;
 	ix_t maxtries;
 	bool_t changedblkszpr;
-	intgen_t rval;
+	int rval;
 	int varblk;
 
 	/* get pointer to drive context
@@ -4055,8 +4055,8 @@ retry:
 	changedblkszpr = BOOL_FALSE;
 	for ( try = 1 ; ; try++ ) {
 		bool_t wasatbotpr;
-		intgen_t nread;
-		intgen_t saved_errno;
+		int nread;
+		int saved_errno;
 
 		if ( cldmgr_stop_requested( )) {
 			return DRIVE_ERROR_STOP;
@@ -4426,7 +4426,7 @@ retry:
 			goto checkhdr;
 		}
 
-		if ( nread < ( intgen_t )tape_recsz
+		if ( nread < ( int )tape_recsz
 		     &&
 		     ! contextp->dc_isvarpr ) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
@@ -4436,7 +4436,7 @@ retry:
 			goto newsize;
 		}
 		
-		if ( nread == ( intgen_t )tape_recsz
+		if ( nread == ( int )tape_recsz
 		     &&
 		     ! contextp->dc_isvarpr ) {
 			mlog( MLOG_DEBUG | MLOG_DRIVE,
@@ -4651,7 +4651,7 @@ static bool_t
 Open( drive_t *drivep )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t oflags;
+	int oflags;
 
 #ifdef DUMP
 	oflags = O_RDWR;
@@ -4691,11 +4691,11 @@ Close( drive_t *drivep )
 	contextp->dc_fd = -1;
 }
 
-static intgen_t
-Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
+static int
+Read( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nread;
+	int nread;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: reading %u bytes\n",
@@ -4713,7 +4713,7 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 		      cnt,
 		      errno,
 		      strerror( errno ));
-	} else if ( nread != ( intgen_t )cnt ) {
+	} else if ( nread != ( int )cnt ) {
 		mlog( MLOG_NITTY | MLOG_DRIVE,
 		      "tape op read of %u bytes short: nread == %d\n",
 		      cnt,
@@ -4727,11 +4727,11 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 	return nread;
 }
 
-static intgen_t
-Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
+static int
+Write( drive_t *drivep, char *bufp, size_t cnt, int *errnop )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nwritten;
+	int nwritten;
 
 	mlog( MLOG_DEBUG | MLOG_DRIVE,
 	      "tape op: writing %u bytes\n",
@@ -4749,7 +4749,7 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
 		      cnt,
 		      errno,
 		      strerror( errno ));
-	} else if ( nwritten != ( intgen_t )cnt ) {
+	} else if ( nwritten != ( int )cnt ) {
 		mlog( MLOG_NITTY | MLOG_DRIVE,
 		      "tape op write of %u bytes short: nwritten == %d\n",
 		      cnt,
@@ -4768,7 +4768,7 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
  * skips skipcnt media files.
  */
 /* ARGSUSED */
-static intgen_t
+static int
 quick_backup( drive_t *drivep, drive_context_t *contextp, ix_t skipcnt )
 {
 	if ( drivep->d_capabilities & DRIVE_CAP_BSF ) {
@@ -4798,7 +4798,7 @@ quick_backup( drive_t *drivep, drive_context_t *contextp, ix_t skipcnt )
 /* validate a record header, log any anomolies, and return appropriate
  * indication.
  */
-static intgen_t
+static int
 record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -4886,18 +4886,18 @@ record_hdr_validate( drive_t *drivep, char *bufp, bool_t chkoffpr )
 /* do a read, determine DRIVE_ERROR_... if failure, and return failure code.
  * return 0 on success.
  */
-static intgen_t
+static int
 read_record(  drive_t *drivep, char *bufp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nread;
-	intgen_t saved_errno;
+	int nread;
+	int saved_errno;
 	mtstat_t mtstat;
-	intgen_t rval;
+	int rval;
 	bool_t ok;
 
 	nread = Read( drivep, bufp, tape_recsz, &saved_errno );
-	if ( nread == ( intgen_t )tape_recsz ) {
+	if ( nread == ( int )tape_recsz ) {
 		contextp->dc_iocnt++;
 		rval = record_hdr_validate( drivep, bufp, BOOL_TRUE );
 		return rval;
@@ -4950,7 +4950,7 @@ read_record(  drive_t *drivep, char *bufp )
 	/* short read
 	 */
 	if ( nread >= 0 ) {
-		assert( nread <= ( intgen_t )tape_recsz );
+		assert( nread <= ( int )tape_recsz );
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "short read record %lld (nread == %d)\n",
 		      contextp->dc_iocnt,
@@ -4978,7 +4978,7 @@ ring_read( void *clientctxp, char *bufp )
 
 /* gets another record IF dc_recp is NULL
  */
-static intgen_t
+static int
 getrec( drive_t *drivep )
 {
 	drive_context_t *contextp;
@@ -4987,7 +4987,7 @@ getrec( drive_t *drivep )
 	while ( ! contextp->dc_recp ) {
 		rec_hdr_t *rechdrp;
 		if ( contextp->dc_singlethreadedpr ) {
-			intgen_t rval;
+			int rval;
 			contextp->dc_recp = contextp->dc_bufp;
 			rval = read_record( drivep, contextp->dc_recp );
 			if ( rval ) {
@@ -5035,13 +5035,13 @@ getrec( drive_t *drivep )
  * return 0 on success.
  */
 /*ARGSUSED*/
-static intgen_t
+static int
 write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nwritten;
-	intgen_t saved_errno;
-	intgen_t rval;
+	int nwritten;
+	int saved_errno;
+	int rval;
 
         if ( xlatepr ) {
 		rec_hdr_t rechdr;
@@ -5055,7 +5055,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
 
 	nwritten = Write( drivep, bufp, tape_recsz, &saved_errno );
 
-	if ( nwritten == ( intgen_t )tape_recsz ) {
+	if ( nwritten == ( int )tape_recsz ) {
 		contextp->dc_iocnt++;
 		return 0;
 	}
@@ -5123,7 +5123,7 @@ calc_max_lost( drive_t *drivep )
 }
 
 static void
-display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
+display_ring_metrics( drive_t *drivep, int mlog_flags )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	ring_t *ringp = contextp->dc_ringp;
@@ -5174,7 +5174,7 @@ rewind_and_verify( drive_t *drivep )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	ix_t try;
-	intgen_t rval;
+	int rval;
 
 	rval = mt_op( contextp->dc_fd, MTREW, 0 );
 	for ( try = 1 ; ; try++ ) {
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 69fce4b..45bc28c 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -84,7 +84,7 @@ struct drive_context {
 	char *dc_nextp;		/* next byte avail. to read/write */
 	char *dc_emptyp;	/* first empty slot in buffer */
 	off64_t dc_bufstroff;	/* offset in stream of top of buf */
-	intgen_t dc_fd;		/* input/output file descriptor */
+	int dc_fd;		/* input/output file descriptor */
 	drive_mark_t dc_firstmark;/* first mark's offset within mfile (dump) */
 	ix_t dc_markcnt;	/* count of marks set (dump) */
 	bool_t dc_rampr;	/* can randomly access file (not a pipe) */
@@ -104,30 +104,30 @@ extern size_t pgsz;
 
 /* strategy functions
  */
-static intgen_t ds_match( int, char *[], drive_t * );
-static intgen_t ds_instantiate( int, char *[], drive_t * );
+static int ds_match( int, char *[], drive_t * );
+static int ds_instantiate( int, char *[], drive_t * );
 
 /* declare manager operators
  */
 static bool_t do_init( drive_t * );
 static bool_t do_sync( drive_t * );
-static intgen_t do_begin_read( drive_t * );
-static char *do_read( drive_t *, size_t , size_t *, intgen_t * );
+static int do_begin_read( drive_t * );
+static char *do_read( drive_t *, size_t , size_t *, int * );
 static void do_return_read_buf( drive_t *, char *, size_t );
 static void do_get_mark( drive_t *, drive_mark_t * );
-static intgen_t do_seek_mark( drive_t *, drive_mark_t * );
-static intgen_t do_next_mark( drive_t * );
+static int do_seek_mark( drive_t *, drive_mark_t * );
+static int do_next_mark( drive_t * );
 static void do_get_mark( drive_t *, drive_mark_t * );
 static void do_end_read( drive_t * );
-static intgen_t do_begin_write( drive_t * );
+static int do_begin_write( drive_t * );
 static void do_set_mark( drive_t *, drive_mcbfp_t, void *, drive_markrec_t * );
 static char * do_get_write_buf( drive_t *, size_t , size_t * );
-static intgen_t do_write( drive_t *, char *, size_t );
+static int do_write( drive_t *, char *, size_t );
 static size_t do_get_align_cnt( drive_t * );
-static intgen_t do_end_write( drive_t *, off64_t * );
-static intgen_t do_rewind( drive_t * );
-static intgen_t do_erase( drive_t * );
-static intgen_t do_get_device_class( drive_t * );
+static int do_end_write( drive_t *, off64_t * );
+static int do_rewind( drive_t * );
+static int do_erase( drive_t * );
+static int do_get_device_class( drive_t * );
 static void do_quit( drive_t * );
 
 
@@ -183,7 +183,7 @@ static drive_ops_t drive_ops = {
 /* strategy match - determines if this is the right strategy
  */
 /* ARGSUSED */
-static intgen_t
+static int
 ds_match( int argc, char *argv[], drive_t *drivep )
 {
 	bool_t isrmtpr;
@@ -265,7 +265,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 		contextp->dc_fd = 0;
 #endif /* RESTORE */
 	} else if ( contextp->dc_isrmtpr ) {
-		intgen_t oflags;
+		int oflags;
 #ifdef DUMP
 		oflags = O_WRONLY | O_CREAT | O_TRUNC;
 #endif /* DUMP */
@@ -285,9 +285,9 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 			return BOOL_FALSE;
 		}
 	} else {
-		intgen_t oflags = 0;
+		int oflags = 0;
 		struct stat statbuf;
-		intgen_t rval;
+		int rval;
 		rval = stat( drivep->d_pathname, &statbuf );
 #ifdef DUMP
 		if ( rval ) {
@@ -419,17 +419,17 @@ do_sync( drive_t *drivep )
 /* drive op begin_read - prepare file for reading - main job is to
  * read the media hdr
  */
-static intgen_t
+static int
 do_begin_read( drive_t *drivep )
 {
 #ifdef DEBUG
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 #endif
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_hdr_t *drhdrp = drivep->d_readhdrp;
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	global_hdr_t		*tmphdr = (global_hdr_t	*)malloc(GLOBAL_HDR_SZ);
 	drive_hdr_t		*tmpdh = (drive_hdr_t *)tmphdr->gh_upper;
 	media_hdr_t		*tmpmh = (media_hdr_t *)tmpdh->dh_upper;
@@ -579,7 +579,7 @@ static char *
 do_read( drive_t *drivep,
          size_t wantedcnt,
          size_t *actualcntp,
-         intgen_t *rvalp )
+         int *rvalp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	size_t remainingcnt;
@@ -734,7 +734,7 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
 /* seek forward to the specified mark. the caller must not have already read
  * past that point.
  */
-static intgen_t
+static int
 do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -742,10 +742,10 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	off64_t nextoff;
 	off64_t strmoff;
 	/* REFERENCED */
-	intgen_t nread;
+	int nread;
 	off64_t nreadneeded64;
-	intgen_t nreadneeded;
-	intgen_t rval;
+	int nreadneeded;
+	int rval;
 
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple seek_mark( )\n" );
@@ -775,7 +775,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		if ( nreadneeded64 > INTGENMAX )
 			nreadneeded = INTGENMAX;
 		else
-			nreadneeded = ( intgen_t )nreadneeded64;
+			nreadneeded = ( int )nreadneeded64;
 		nread = read_buf( 0, nreadneeded, drivep,
 				  ( rfp_t )drivep->d_opsp->do_read,
 				( rrbfp_t )drivep->d_opsp->do_return_read_buf,
@@ -799,15 +799,15 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
  * mark in the media file (recorded in the header). if the caller
  * has already read past that mark, blow up.
  */
-static intgen_t
+static int
 do_next_mark( drive_t *drivep )
 {
 #ifdef DEBUG
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 #endif
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	drive_mark_t mark = contextp->dc_firstmark;
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple next_mark( )\n" );
@@ -854,10 +854,10 @@ do_end_read( drive_t *drivep )
 
 /* begin_write - prepare file for writing
  */
-static intgen_t
+static int
 do_begin_write( drive_t *drivep )
 {
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -1055,7 +1055,7 @@ do_set_mark( drive_t *drivep,
 			drive_hdr_t		*dwhdrp = drivep->d_writehdrp;
 			off64_t			newoff;
 			/* REFERENCED */
-			intgen_t		nwritten;
+			int		nwritten;
 
 			/* assert the header has been flushed
 			 */
@@ -1219,7 +1219,7 @@ do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
  * caller.
  */
 /*ARGSUSED*/
-static intgen_t
+static int
 do_write( drive_t *drivep, char *bufp, size_t writesz )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -1265,7 +1265,7 @@ do_write( drive_t *drivep, char *bufp, size_t writesz )
 	/* if buffer is full, flush it
 	 */
 	if ( contextp->dc_nextp == contextp->dc_emptyp ) {
-		intgen_t nwritten;
+		int nwritten;
 
 		mlog( MLOG_DEBUG | MLOG_DRIVE,
 		      "flushing write buf addr 0x%x size 0x%x\n",
@@ -1333,7 +1333,7 @@ do_get_align_cnt( drive_t *drivep )
 /* end_write - flush any buffered data, and return by reference how many
  * bytes were committed.
  */
-static intgen_t
+static int
 do_end_write( drive_t *drivep, off64_t *ncommittedp )
 {
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
@@ -1402,11 +1402,11 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
 
 /* rewind - return the current file offset to the beginning
  */
-intgen_t
+int
 do_rewind( drive_t *drivep )
 {
 #ifdef DEBUG
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 #endif
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	off64_t newoff;
@@ -1437,15 +1437,15 @@ do_rewind( drive_t *drivep )
 
 /* erase - truncate to zero length
  */
-intgen_t
+int
 do_erase( drive_t *drivep )
 {
 #ifdef DEBUG
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 #endif
 	drive_context_t *contextp = ( drive_context_t * )drivep->d_contextp;
 	off64_t newoff;
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_NITTY | MLOG_DRIVE,
 	      "drive_simple erase( )\n" );
@@ -1487,7 +1487,7 @@ do_erase( drive_t *drivep )
 /* get_media_class()
  */
 /* ARGSUSED */
-static intgen_t 
+static int 
 do_get_device_class( drive_t *drivep )
 {
 	mlog( MLOG_NITTY | MLOG_DRIVE,
diff --git a/common/exit.h b/common/exit.h
index f7e4878..403946d 100644
--- a/common/exit.h
+++ b/common/exit.h
@@ -26,7 +26,7 @@
 #define EXIT_FAULT	4	/* code fault */
 
 static inline const char *
-exit_codestring( intgen_t code )
+exit_codestring( int code )
 {
 	switch ( code ) {
 	case EXIT_NORMAL:    return "SUCCESS";
diff --git a/common/fs.c b/common/fs.c
index 2cd2f72..184f08d 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -109,12 +109,12 @@ static fs_tab_ent_t *fs_tab_lookup_mnt( char * );
 /* ARGSUSED */
 bool_t
 fs_info( char *typb,		/* out */
-	 intgen_t typbz,
+	 int typbz,
 	 char *typd,
 	 char *blkb,		/* out */
-	 intgen_t blkbz,
+	 int blkbz,
 	 char *mntb,		/* out */
-	 intgen_t mntbz,
+	 int mntbz,
 	 uuid_t *idb,		/* out */
 	 char *usrs )		/* in */
 {
@@ -169,7 +169,7 @@ fs_info( char *typb,		/* out */
 	assert( ok != BOOL_UNKNOWN );
 
 	if ( ok == BOOL_TRUE ) {
-		intgen_t rval = fs_getid( mntb, idb );
+		int rval = fs_getid( mntb, idb );
 		if ( rval ) {
 			mlog( MLOG_NORMAL,
 			      _("unable to determine uuid of fs mounted at %s: "
@@ -201,7 +201,7 @@ fs_mounted( char *typs, char *chrs, char *mnts, uuid_t *idp )
 	return strlen( mnts ) > 0 ? BOOL_TRUE : BOOL_FALSE;
 }
 
-intgen_t
+int
 fs_getid( char *mnts, uuid_t *idb )
 {
 	xfs_fsop_geom_v1_t geo;
@@ -227,7 +227,7 @@ size_t
 fs_getinocnt( char *mnts )
 {
 	struct statvfs vfsstat;
-	intgen_t rval;
+	int rval;
 
 	rval = statvfs( mnts, &vfsstat );
 	if ( rval ) {
diff --git a/common/fs.h b/common/fs.h
index 9ad1636..4a9d9d1 100644
--- a/common/fs.h
+++ b/common/fs.h
@@ -32,12 +32,12 @@
  * returns BOOL_FALSE if srcname does not describe a file system.
  */
 extern bool_t fs_info( char *fstype,		/* out: fs type (fsid.h) */
-		       intgen_t fstypesz,	/* in: buffer size */
+		       int fstypesz,	/* in: buffer size */
 		       char *fstypedef,		/* in: default fs type */
 		       char *fsdevice,		/* out: blk spec. dev. file */
-		       intgen_t fsdevicesz,	/* in: buffer size */
+		       int fsdevicesz,	/* in: buffer size */
 		       char *mntpt,		/* out: where fs mounted */
-		       intgen_t mntptsz,	/* in: buffer size */
+		       int mntptsz,	/* in: buffer size */
 		       uuid_t *fsid,		/* out: fs uuid */
 		       char *srcname );		/* in: how user named the fs */
 
@@ -51,7 +51,7 @@ extern bool_t fs_mounted( char *fstype,
 /* fs_getid - retrieves the uuid of the file system containing the named
  * file. returns -1 with errno set on error.
  */
-extern intgen_t fs_getid( char *fullpathname, uuid_t *fsidp );
+extern int fs_getid( char *fullpathname, uuid_t *fsidp );
 
 /* tells how many inos in use
  */
diff --git a/common/global.c b/common/global.c
index 319d4df..2129941 100644
--- a/common/global.c
+++ b/common/global.c
@@ -58,7 +58,7 @@ static char * prompt_label( char *bufp, size_t bufsz );
 /* definition of locally defined global functions ****************************/
 
 global_hdr_t *
-global_hdr_alloc( intgen_t argc, char *argv[ ] )
+global_hdr_alloc( int argc, char *argv[ ] )
 {
 	global_hdr_t *ghdrp;
 	int c;
@@ -68,7 +68,7 @@ global_hdr_alloc( intgen_t argc, char *argv[ ] )
 	struct stat64 statb;
 #endif /* DUMP */
 
-	intgen_t rval;
+	int rval;
 
 	/* sanity checks
 	 */
diff --git a/common/global.h b/common/global.h
index 6556a68..537be0c 100644
--- a/common/global.h
+++ b/common/global.h
@@ -73,7 +73,7 @@ typedef struct global_hdr global_hdr_t;
 /* used by main( ) to allocate and populate a global header template.
  * drive managers will copy this into the write header.
  */
-extern global_hdr_t * global_hdr_alloc( intgen_t argc, char *argv[ ] );
+extern global_hdr_t * global_hdr_alloc( int argc, char *argv[ ] );
 
 
 /* used by main( ) to free the global header template after drive ini.
diff --git a/common/inventory.c b/common/inventory.c
index 681d28f..d1c067b 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -232,7 +232,7 @@ inv_writesession_open(
 {
 	invt_session_t *ses;
 	int		fd;
-	intgen_t	rval;
+	int	rval;
 	invt_sescounter_t *sescnt = NULL;
 	invt_seshdr_t  	hdr;
 	inv_sestoken_t	sestok;
@@ -547,7 +547,7 @@ inv_put_mediafile(
 /*          get                                                         */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 inv_get_inolist(
 	inv_inolist_t 	**inolist )
 {
diff --git a/common/inventory.h b/common/inventory.h
index ee5a977..351f6e0 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -237,7 +237,7 @@ inv_DEBUG_printallsessions(
 
 #endif /* ifdef DEBUG */
 
-extern intgen_t
+extern int
 inv_setup_base( void );
 
 extern char *
diff --git a/common/main.c b/common/main.c
index 3b82a76..08bf574 100644
--- a/common/main.c
+++ b/common/main.c
@@ -103,7 +103,7 @@ static bool_t set_rlimits( void );
 #ifdef RESTORE
 static bool_t set_rlimits( size64_t * );
 #endif /* RESTORE */
-static char *sig_numstring( intgen_t num );
+static char *sig_numstring( int num );
 static char *strpbrkquotes( char *p, const char *sep );
 
 
@@ -133,7 +133,7 @@ static bool_t sigterm_received;
 static bool_t sigquit_received;
 static bool_t sigint_received;
 /* REFERENCED */
-static intgen_t sigstray_received;
+static int sigstray_received;
 static bool_t progrpt_enabledpr;
 static time32_t progrpt_interval;
 static time32_t progrpt_deadline;
@@ -156,11 +156,11 @@ main( int argc, char *argv[] )
 #endif /* DUMP */
 	bool_t init_error;
 	bool_t coredump_requested = BOOL_FALSE;
-	intgen_t exitcode;
+	int exitcode;
 	rlim64_t tmpstacksz;
 	struct sigaction sa;
-	intgen_t prbcld_xc = EXIT_NORMAL;
-	intgen_t xc;
+	int prbcld_xc = EXIT_NORMAL;
+	int xc;
 	bool_t ok;
 	/* REFERENCED */
 	int rval;
@@ -371,7 +371,7 @@ main( int argc, char *argv[] )
 	mlog( MLOG_DEBUG | MLOG_PROC,
 	      "getpagesize( ) returns %u\n",
 	      pgsz );
-	assert( ( intgen_t )pgsz > 0 );
+	assert( ( int )pgsz > 0 );
 	pgmask = pgsz - 1;
 
 	/* report parent tid
@@ -571,7 +571,7 @@ main( int argc, char *argv[] )
 	/* if in a pipeline, go single-threaded with just one stream.
 	 */
 	if ( pipeline ) {
-		intgen_t exitcode;
+		int exitcode;
 
 		sa.sa_handler = sighandler;
 		sigaction( SIGINT, &sa, NULL );
@@ -662,12 +662,12 @@ main( int argc, char *argv[] )
 	 * signals.
 	 */
 	if ( progrpt_enabledpr ) {
-		( void )alarm( ( u_intgen_t )progrpt_interval );
+		( void )alarm( ( u_int )progrpt_interval );
 	}
 	for ( ; ; ) {
 		time32_t now;
 		bool_t stop_requested = BOOL_FALSE;
-		intgen_t stop_timeout = -1;
+		int stop_timeout = -1;
 		sigset_t empty_set;
 
 		/* if there was an initialization error,
@@ -805,7 +805,7 @@ main( int argc, char *argv[] )
 		/* set alarm if needed (note time stands still during dialog)
 		 */
 		if ( stop_in_progress ) {
-			intgen_t timeout = ( intgen_t )( stop_deadline - now );
+			int timeout = ( int )( stop_deadline - now );
 			if ( timeout < 0 ) {
 				timeout = 0;
 			}
@@ -813,7 +813,7 @@ main( int argc, char *argv[] )
 			      "setting alarm for %d second%s\n",
 			      timeout,
 			      timeout == 1 ? "" : "s" );
-			( void )alarm( ( u_intgen_t )timeout );
+			( void )alarm( ( u_int )timeout );
 			if ( timeout == 0 ) {
 				continue;
 			}
@@ -835,7 +835,7 @@ main( int argc, char *argv[] )
 					      statline[ i ] );
 				}
 			}
-			( void )alarm( ( u_intgen_t )( progrpt_deadline
+			( void )alarm( ( u_int )( progrpt_deadline
 						       -
 						       now ));
 		}
@@ -1112,22 +1112,22 @@ preemptchk( int flg )
 /* definition of locally defined static functions ****************************/
 
 static bool_t
-loadoptfile( intgen_t *argcp, char ***argvp )
+loadoptfile( int *argcp, char ***argvp )
 {
 	char *optfilename;
 	ix_t optfileix = 0;
-	intgen_t fd;
+	int fd;
 	size_t sz;
-	intgen_t i;
+	int i;
 	struct stat64 stat;
 	char *argbuf;
 	char *p;
 	size_t tokencnt;
-	intgen_t nread;
+	int nread;
 	const char *sep = " \t\n\r";
 	char **newargv;
-	intgen_t c;
-	intgen_t rval;
+	int c;
+	int rval;
 
 	/* see if option specified
 	 */
@@ -1202,7 +1202,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	 */
 	sz = 0;
 	for ( i =  0 ; i < *argcp ; i++ ) {
-		if ( i == ( intgen_t )optfileix ) {
+		if ( i == ( int )optfileix ) {
 			i++; /* to skip option argument */
 			continue;
 		}
@@ -1246,7 +1246,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* copy the remaining command line args into the buffer
 	 */
 	for ( ; i < *argcp ; i++ ) {
-		if ( i == ( intgen_t )optfileix ) {
+		if ( i == ( int )optfileix ) {
 			i++; /* to skip option argument */
 			continue;
 		}
@@ -1262,7 +1262,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* change newlines and carriage returns into spaces
 	 */
 	for ( p = argbuf ; *p ; p++ ) {
-		if ( strchr( "\n\r", ( intgen_t )( *p ))) {
+		if ( strchr( "\n\r", ( int )( *p ))) {
 			*p = ' ';
 		}
 	}
@@ -1274,7 +1274,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	for ( ; ; ) {
 		/* start at the first non-separator character
 		 */
-		while ( *p && strchr( sep, ( intgen_t )( *p ))) {
+		while ( *p && strchr( sep, ( int )( *p ))) {
 			p++;
 		}
 
@@ -1320,7 +1320,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 
 		/* start at the first non-separator character
 		 */
-		while ( *p && strchr( sep, ( intgen_t )*p )) {
+		while ( *p && strchr( sep, ( int )*p )) {
 			p++;
 		}
 
@@ -1332,7 +1332,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 
 		/* better not disagree with counting scan!
 		 */
-		assert( i < ( intgen_t )tokencnt );
+		assert( i < ( int )tokencnt );
 
 		/* find the end of the first token
 		 */
@@ -1364,7 +1364,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
 	/* return new argc anr argv
 	 */
 	close( fd );
-	*argcp = ( intgen_t )tokencnt;
+	*argcp = ( int )tokencnt;
 	*argvp = newargv;
 	return BOOL_TRUE;
 }
@@ -1382,7 +1382,7 @@ sighandler( int signo )
 	/* if in pipeline, don't do anything risky. just quit.
 	 */
 	if ( pipeline ) {
-		intgen_t rval;
+		int rval;
 
 		mlog( MLOG_TRACE | MLOG_NOTE | MLOG_NOLOCK | MLOG_PROC,
 		      _("received signal %d (%s): cleanup and exit\n"),
@@ -1433,7 +1433,7 @@ static int
 childmain( void *arg1 )
 {
 	ix_t stix;
-	intgen_t exitcode;
+	int exitcode;
 	drive_t *drivep;
 
 	/* Determine which stream I am.
@@ -1519,7 +1519,7 @@ sigint_dialog( void )
 	size_t allix;
 	size_t nochangeix;
 	size_t responseix;
-	intgen_t ssselected = 0;
+	int ssselected = 0;
 	bool_t stop_requested = BOOL_FALSE;
 
 	/* preamble: the content status line, indicate if interrupt happening
@@ -1661,7 +1661,7 @@ sigint_dialog( void )
 			ssselected = -1;
 			ackstr[ ackcnt++ ] = _("all subsystems selected\n\n");
 		} else {
-			ssselected = ( intgen_t )responseix;
+			ssselected = ( int )responseix;
 			ackstr[ ackcnt++ ] = "\n";
 		}
 		dlog_multi_ack( ackstr,
@@ -1721,11 +1721,11 @@ sigint_dialog( void )
 					      ;
 					      ssix++ ) {
 						mlog_level_ss[ ssix ] =
-							( intgen_t )responseix;
+							( int )responseix;
 					}
 				} else {
 					mlog_level_ss[ ssselected ] =
-							( intgen_t )responseix;
+							( int )responseix;
 				}
 				ackstr[ ackcnt++ ] = _("level changed\n");
 			}
@@ -1888,7 +1888,7 @@ sigint_dialog( void )
 							ncix,  /* sigquit ix */
 							okix );
 			if ( responseix == okix ) {
-				intgen_t newinterval;
+				int newinterval;
 				newinterval = atoi( buf );
 				if ( ! strlen( buf )) {
 					ackstr[ ackcnt++ ] = _("no change\n");
@@ -1982,11 +1982,11 @@ sigint_dialog( void )
 static char *
 sigintstr( void )
 {
-	intgen_t ttyfd;
+	int ttyfd;
 	static char buf[ 20 ];
 	struct termios termios;
 	cc_t intchr;
-	intgen_t rval;
+	int rval;
 
 	ttyfd = dlog_fd( );
 	if ( ttyfd == -1 ) {
@@ -2034,7 +2034,7 @@ set_rlimits( size64_t *vmszp )
 	size64_t vmsz;
 #endif /* RESTORE */
 	/* REFERENCED */
-	intgen_t rval;
+	int rval;
 
 	assert( minstacksz <= maxstacksz );
 
@@ -2203,7 +2203,7 @@ set_rlimits( size64_t *vmszp )
 }
 
 struct sig_printmap {
-	intgen_t num;
+	int num;
 	char *string;
 };
 
@@ -2240,7 +2240,7 @@ static sig_printmap_t sig_printmap[ ] = {
 };
 
 static char *
-sig_numstring( intgen_t num )
+sig_numstring( int num )
 {
 	sig_printmap_t *p = sig_printmap;
 	sig_printmap_t *endp = sig_printmap
@@ -2291,7 +2291,7 @@ strpbrkquotes( char *p, const char *sep )
 		}
 
 		if ( ! inquotes ) {
-			if ( strchr( sep, ( intgen_t )( *p ))) {
+			if ( strchr( sep, ( int )( *p ))) {
 				return p;
 			}
 		}
diff --git a/common/media.c b/common/media.c
index 7d17405..fceb78d 100644
--- a/common/media.c
+++ b/common/media.c
@@ -89,7 +89,7 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
 					     /
 					     sizeof( strategyp[ 0 ] );
 	media_strategy_t *chosen_sp;
-	intgen_t id;
+	int id;
 	bool_t ok;
 
 	/* sanity check asserts
diff --git a/common/mlog.c b/common/mlog.c
index 1fef185..fd21c18 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -54,15 +54,15 @@ static FILE *mlog_fp = NULL; /* stderr */;
 static FILE *mlog_fp = NULL; /* stdout */;
 #endif /* RESTORE */
 
-intgen_t mlog_level_ss[ MLOG_SS_CNT ];
+int mlog_level_ss[ MLOG_SS_CNT ];
 
-intgen_t mlog_showlevel = BOOL_FALSE;
+int mlog_showlevel = BOOL_FALSE;
 
-intgen_t mlog_showss = BOOL_FALSE;
+int mlog_showss = BOOL_FALSE;
 
-intgen_t mlog_timestamp = BOOL_FALSE;
+int mlog_timestamp = BOOL_FALSE;
 
-static intgen_t mlog_sym_lookup( char * );
+static int mlog_sym_lookup( char * );
 
 static size_t mlog_streamcnt;
 
@@ -84,7 +84,7 @@ static char mlog_tsstr[ 10 ];
 
 struct mlog_sym {
 	char *sym;
-	intgen_t level;
+	int level;
 };
 
 typedef struct mlog_sym mlog_sym_t;
@@ -146,13 +146,13 @@ mlog_init0( void )
 }
 
 bool_t
-mlog_init1( intgen_t argc, char *argv[ ] )
+mlog_init1( int argc, char *argv[ ] )
 {
 	char **suboptstrs;
 	ix_t ssix;
 	ix_t soix;
 	size_t vsymcnt;
-	intgen_t c;
+	int c;
 
 	/* prepare an array of suboption token strings. this will be the
 	 * concatenation of the subsystem names with the verbosity symbols.
@@ -200,7 +200,7 @@ mlog_init1( intgen_t argc, char *argv[ ] )
 			}
 			options = optarg;
 			while ( *options ) {
-				intgen_t suboptix;
+				int suboptix;
 				char *valstr;
 
 				suboptix = getsubopt( &options, 
@@ -343,9 +343,9 @@ mlog_unlock( void )
  * too much output.
  */
 void
-mlog_override_level( intgen_t levelarg )
+mlog_override_level( int levelarg )
 {
-	intgen_t level;
+	int level;
 	ix_t ss; /* SubSystem */
 
 	level = levelarg & MLOG_LEVELMASK;
@@ -362,7 +362,7 @@ mlog_override_level( intgen_t levelarg )
 }
 
 void
-mlog( intgen_t levelarg, char *fmt, ... )
+mlog( int levelarg, char *fmt, ... )
 {
 	va_list args;
 	va_start( args, fmt );
@@ -371,9 +371,9 @@ mlog( intgen_t levelarg, char *fmt, ... )
 }
 
 void
-mlog_va( intgen_t levelarg, char *fmt, va_list args )
+mlog_va( int levelarg, char *fmt, va_list args )
 {
-	intgen_t level;
+	int level;
 	ix_t ss;
 
 	level = levelarg & MLOG_LEVELMASK;
@@ -389,7 +389,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
 	}
 
 	if ( ! ( levelarg & MLOG_BARE )) {
-		intgen_t streamix;
+		int streamix;
 		streamix = stream_getix( pthread_self( ) );
 
 		if ( mlog_showss ) {
@@ -419,7 +419,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
 				mlog_levelstr[ 1 ] = ( char )
 						     ( level
 						       +
-						       ( intgen_t )'0' );
+						       ( int )'0' );
 			}
 		} else {
 			mlog_levelstr[ 0 ] = 0;
@@ -609,7 +609,7 @@ _mlog_exit( const char *file, int line, int exit_code, rv_t rv )
 	else {
 		stream_state_t states[] = { S_RUNNING };
 		stream_state_t state;
-		intgen_t streamix;
+		int streamix;
 		int exit_code;
 		rv_t exit_return, exit_hint;
 
@@ -726,7 +726,7 @@ mlog_exit_flush(void)
 
 		for (i = 0; i < ntids; i++) {
 			stream_state_t state;
-			intgen_t streamix;
+			int streamix;
 			int exit_code;
 			rv_t exit_return, exit_hint;
 			/* REFERENCED */
@@ -786,7 +786,7 @@ mlog_exit_flush(void)
 	fflush(mlog_fp);
 }
 
-static intgen_t
+static int
 mlog_sym_lookup( char *sym )
 {
 	mlog_sym_t *p = mlog_sym;
diff --git a/common/mlog.h b/common/mlog.h
index ce143bd..d7bbfce 100644
--- a/common/mlog.h
+++ b/common/mlog.h
@@ -80,13 +80,13 @@
 /* mlog_level - set during initialization, exported to facilitate
  * message logging decisions. one per subsystem (see above)
  */
-extern intgen_t mlog_level_ss[ MLOG_SS_CNT ];
+extern int mlog_level_ss[ MLOG_SS_CNT ];
 
 /* made external so main.c sigint dialog can change
  */
-extern intgen_t mlog_showlevel;
-extern intgen_t mlog_showss;
-extern intgen_t mlog_timestamp;
+extern int mlog_showlevel;
+extern int mlog_showss;
+extern int mlog_timestamp;
 
 /* mlog_ss_name - so main.c sigint dialog can allow changes
  */
@@ -96,7 +96,7 @@ extern char *mlog_ss_names[ MLOG_SS_CNT ];
  * unravel some initialization sequencing problems.
  */
 extern void mlog_init0( void );
-extern bool_t mlog_init1( intgen_t argc, char *argv[ ] );
+extern bool_t mlog_init1( int argc, char *argv[ ] );
 extern bool_t mlog_init2( void );
 
 /* post-initialization, to tell mlog how many streams
@@ -105,12 +105,12 @@ extern void mlog_tell_streamcnt( size_t streamcnt );
 
 /* override the -v option
  */
-void mlog_override_level( intgen_t levelarg );
+void mlog_override_level( int levelarg );
 
 /* vprintf-based message format
  */
-extern void mlog( intgen_t level, char *fmt, ... );
-extern void mlog_va( intgen_t levelarg, char *fmt, va_list args );
+extern void mlog( int level, char *fmt, ... );
+extern void mlog_va( int levelarg, char *fmt, va_list args );
 #define mlog_exit( e, r ) _mlog_exit( __FILE__, __LINE__, (e), (r) )
 extern int  _mlog_exit( const char *file, int line, int exit_code, rv_t return_code );
 #define mlog_exit_hint( r ) _mlog_exit_hint( __FILE__, __LINE__, (r) )
diff --git a/common/openutil.c b/common/openutil.c
index 9df42ae..6cc0efa 100644
--- a/common/openutil.c
+++ b/common/openutil.c
@@ -73,10 +73,10 @@ open_pathalloc( char *dirname, char *basename, pid_t pid )
   	return namebuf;
 }
 
-intgen_t
+int
 open_trwp( char *pathname )
 {
-	intgen_t fd;
+	int fd;
 
 	fd = open( pathname, O_CREAT | O_TRUNC | O_RDWR, S_IRUSR | S_IWUSR );
 	if ( fd < 0 ) {
@@ -89,10 +89,10 @@ open_trwp( char *pathname )
 	return fd;
 }
 
-intgen_t
+int
 open_erwp( char *pathname )
 {
-	intgen_t fd;
+	int fd;
 
 	fd = open( pathname, O_EXCL | O_CREAT | O_RDWR, S_IRUSR | S_IWUSR );
 	if ( fd < 0 ) {
@@ -105,31 +105,31 @@ open_erwp( char *pathname )
 	return fd;
 }
 
-intgen_t
+int
 open_rwp( char *pathname )
 {
-	intgen_t fd;
+	int fd;
 
 	fd = open( pathname, O_RDWR );
 
 	return fd;
 }
 
-intgen_t
+int
 mkdir_tp( char *pathname )
 {
-	intgen_t rval;
+	int rval;
 
 	rval = mkdir( pathname, S_IRWXU );
 
 	return rval;
 }
 
-intgen_t
+int
 open_trwdb( char *dirname, char *basename, pid_t pid )
 {
 	char *pathname;
-	intgen_t fd;
+	int fd;
 
 	pathname = open_pathalloc( dirname, basename, pid );
 	fd = open_trwp( pathname );
@@ -138,11 +138,11 @@ open_trwdb( char *dirname, char *basename, pid_t pid )
 	return fd;
 }
 
-intgen_t
+int
 open_erwdb( char *dirname, char *basename, pid_t pid )
 {
 	char *pathname;
-	intgen_t fd;
+	int fd;
 
 	pathname = open_pathalloc( dirname, basename, pid );
 	fd = open_erwp( pathname );
@@ -151,11 +151,11 @@ open_erwdb( char *dirname, char *basename, pid_t pid )
 	return fd;
 }
 
-intgen_t
+int
 open_rwdb( char *dirname, char *basename, pid_t pid )
 {
 	char *pathname;
-	intgen_t fd;
+	int fd;
 
 	pathname = open_pathalloc( dirname, basename, pid );
 	fd = open_rwp( pathname );
diff --git a/common/openutil.h b/common/openutil.h
index c00233d..587462c 100644
--- a/common/openutil.h
+++ b/common/openutil.h
@@ -35,28 +35,28 @@ extern char *open_pathalloc( char *dirname, char *basename, pid_t pid );
  * return the file descriptor, or -1 with errno set. uses mlog( MLOG_NORMAL...
  * if the creation fails.
  */
-extern intgen_t open_trwdb( char *dirname, char *basename, pid_t pid );
-extern intgen_t open_trwp( char *pathname );
+extern int open_trwdb( char *dirname, char *basename, pid_t pid );
+extern int open_trwp( char *pathname );
 
 
 /* open the specified file, with read and write permissions, given a
  * directory and base.* return the file descriptor, or -1 with errno set.
  * uses mlog( MLOG_NORMAL... if the open fails.
  */
-extern intgen_t open_rwdb( char *dirname, char *basename, pid_t pid );
-extern intgen_t open_rwp( char *pathname );
+extern int open_rwdb( char *dirname, char *basename, pid_t pid );
+extern int open_rwp( char *pathname );
 
 
 /* create and open the specified file, failing if already exists
  */
-extern intgen_t open_erwp( char *pathname );
-extern intgen_t open_erwdb( char *dirname, char *basename, pid_t pid );
+extern int open_erwp( char *pathname );
+extern int open_erwdb( char *dirname, char *basename, pid_t pid );
 
 
 /* create the specified directory, guaranteed to be initially empty. returns
  * 0 on success, -1 if trouble. uses mlog( MLOG_NORMAL... if the creation fails.
  */
-extern intgen_t mkdir_tp( char *pathname );
+extern int mkdir_tp( char *pathname );
 
 
 #endif /* UTIL_H */
diff --git a/common/qlock.c b/common/qlock.c
index 1b466d6..0583a63 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -106,7 +106,7 @@ qlock_lock( qlockh_t qlockh )
 	qlock_t *qlockp = ( qlock_t * )qlockh;
 	pthread_t tid;
 	/* REFERENCED */
-	intgen_t rval;
+	int rval;
 	
 	/* get the caller's tid
 	 */
@@ -149,7 +149,7 @@ qlock_unlock( qlockh_t qlockh )
 {
 	qlock_t *qlockp = ( qlock_t * )qlockh;
 	/* REFERENCED */
-	intgen_t rval;
+	int rval;
 	
 	/* verify lock is held by this thread
 	 */
@@ -169,7 +169,7 @@ qsemh_t
 qsem_alloc( ix_t cnt )
 {
 	sem_t *semp;
-	intgen_t rval;
+	int rval;
 
 	/* allocate a semaphore
 	 */
@@ -188,7 +188,7 @@ void
 qsem_free( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
-	intgen_t rval;
+	int rval;
 
 	/* destroy the mutex and condition
 	 */
@@ -204,7 +204,7 @@ void
 qsemP( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
-	intgen_t rval;
+	int rval;
 	
 	/* "P" the semaphore
 	 */
@@ -216,7 +216,7 @@ void
 qsemV( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
-	intgen_t rval;
+	int rval;
 	
 	/* "V" the semaphore
 	 */
@@ -229,7 +229,7 @@ qsemPwouldblock( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
 	int count;
-	intgen_t rval;
+	int rval;
 
 	rval = sem_getvalue( semp, &count );
 	assert( !rval );
@@ -242,7 +242,7 @@ qsemPavail( qsemh_t qsemh )
 {
 	sem_t *semp = ( sem_t * )qsemh;
 	int count;
-	intgen_t rval;
+	int rval;
 
 	rval = sem_getvalue( semp, &count );
 	assert( !rval );
diff --git a/common/ring.c b/common/ring.c
index 37a2d1d..bb90901 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -46,7 +46,7 @@ ring_create( size_t ringlen,
 	     int ( *readfunc )( void *clientctxp, char *bufp ),
 	     int ( *writefunc )( void *clientctxp, char *bufp ),
 	     void *clientctxp,
-	     intgen_t *rvalp )
+	     int *rvalp )
 {
 	bool_t ok;
 	ring_t *ringp;
@@ -107,7 +107,7 @@ ring_create( size_t ringlen,
 			return 0;
 		}
 		if ( pinpr ) {
-			intgen_t rval;
+			int rval;
 			rval = mlock( ( void * )msgp->rm_bufp, bufsz );
 			if ( rval ) {
 				if ( errno == ENOMEM ) {
diff --git a/common/ring.h b/common/ring.h
index caa505c..4a1cc54 100644
--- a/common/ring.h
+++ b/common/ring.h
@@ -113,7 +113,7 @@ typedef enum ring_loc ring_loc_t;
 struct ring_msg {
 	ring_op_t rm_op;
 	ring_stat_t rm_stat;
-	intgen_t rm_rval;
+	int rm_rval;
 	off64_t rm_user;
 	char *rm_bufp;
 /* ALL BELOW PRIVATE!!! */
@@ -171,7 +171,7 @@ extern ring_t *ring_create( size_t ringlen,
 			    int ( * readfunc )( void *clientctxp, char *bufp ),
 			    int ( * writefunc )( void *clientctxp, char *bufp ),
 			    void *clientctxp,
-			    intgen_t *rvalp );
+			    int *rvalp );
 
 
 /* ring_get - get a message off the ready queue
diff --git a/common/stream.c b/common/stream.c
index 90d315a..549bf59 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -36,7 +36,7 @@
 struct spm {
 	stream_state_t	s_state;
 	pthread_t	s_tid;
-	intgen_t	s_ix;
+	int	s_ix;
 	int		s_exit_code;
 	rv_t		s_exit_return;
 	rv_t		s_exit_hint;
@@ -64,7 +64,7 @@ stream_init( void )
  */
 
 void
-stream_register( pthread_t tid, intgen_t streamix )
+stream_register( pthread_t tid, int streamix )
 {
 	spm_t *p = spm;
 	spm_t *ep = spm + N(spm);
@@ -187,12 +187,12 @@ stream_find( pthread_t tid, stream_state_t s[], int nstates )
  * another lock. So no locking is done in this function.
  */
 
-intgen_t
+int
 stream_getix( pthread_t tid )
 {
 	stream_state_t states[] = { S_RUNNING };
 	spm_t *p;
-	intgen_t ix;
+	int ix;
 	p = stream_find( tid, states, N(states) );
 	ix = p ? p->s_ix : -1;
 	return ix;
@@ -246,7 +246,7 @@ stream_get_exit_status( pthread_t tid,
 			stream_state_t states[],
 			int nstates,
 			stream_state_t *state,
-			intgen_t *ix,
+			int *ix,
 			int *exit_code,
 			rv_t *exit_return,
 			rv_t *exit_hint)
diff --git a/common/stream.h b/common/stream.h
index 4b3799f..a83a5a5 100644
--- a/common/stream.h
+++ b/common/stream.h
@@ -42,7 +42,7 @@
 typedef enum { S_FREE, S_RUNNING, S_ZOMBIE } stream_state_t;
 
 extern void stream_init( void );
-extern void stream_register( pthread_t tid, intgen_t streamix );
+extern void stream_register( pthread_t tid, int streamix );
 /* NOTE: lock() must be held when calling stream_dead */
 extern void stream_dead( pthread_t tid );
 extern void stream_free( pthread_t tid );
@@ -50,7 +50,7 @@ extern int stream_find_all( stream_state_t states[],
 			    int nstates,
 			    pthread_t tids[],
 			    int ntids );
-extern intgen_t stream_getix( pthread_t tid );
+extern int stream_getix( pthread_t tid );
 extern void stream_set_code( pthread_t tid, int code );
 extern void stream_set_return( pthread_t tid, rv_t rv );
 extern void stream_set_hint( pthread_t tid, rv_t rv );
@@ -59,7 +59,7 @@ extern bool_t stream_get_exit_status( pthread_t tid,
 				      stream_state_t states[],
 				      int nstates,
 				      stream_state_t *state,
-				      intgen_t *ix,
+				      int *ix,
 				      int *exit_code,
 				      rv_t *exit_return,
 				      rv_t *exit_hint);
diff --git a/common/types.h b/common/types.h
index 9d3606a..9afb3a7 100644
--- a/common/types.h
+++ b/common/types.h
@@ -38,7 +38,7 @@ typedef u_int32_t size32_t;
 typedef u_int64_t size64_t;
 typedef char char_t;
 typedef unsigned char u_char_t;
-typedef unsigned int u_intgen_t;
+typedef unsigned int u_int;
 typedef long long_t;
 typedef unsigned long u_long_t;
 typedef size_t ix_t;
@@ -70,8 +70,8 @@ typedef int32_t time32_t;
 #define SIZE64MAX	MKUMAX( size64_t )
 #define INO64MAX	MKUMAX( xfs_ino_t )
 #define OFF64MAX	MKSMAX( off64_t )
-#define INTGENMAX	MKSMAX( intgen_t )
-#define UINTGENMAX	MKUMAX( u_intgen_t )
+#define INTGENMAX	MKSMAX( int )
+#define UINTGENMAX	MKUMAX( u_int )
 #define OFFMAX		MKSMAX( off_t )
 #define SIZEMAX		MKUMAX( size_t )
 #define IXMAX		MKUMAX( size_t )
diff --git a/common/util.c b/common/util.c
index af48162..93dd9c8 100644
--- a/common/util.c
+++ b/common/util.c
@@ -39,7 +39,7 @@
 
 extern size_t pgsz;
 
-intgen_t
+int
 write_buf( char *bufp,
 	   size_t bufsz,
 	   void *contextp,
@@ -73,17 +73,17 @@ write_buf( char *bufp,
 	return 0;
 }
 
-intgen_t
+int
 read_buf( char *bufp,
 	  size_t bufsz, 
 	  void *contextp,
 	  rfp_t read_funcp,
 	  rrbfp_t return_read_buf_funcp,
-	  intgen_t *statp )
+	  int *statp )
 {
 	char *mbufp;		/* manager's buffer pointer */
 	size_t mbufsz;	/* size of manager's buffer */
-	intgen_t nread;
+	int nread;
 
 	nread = 0;
 	*statp = 0;
@@ -98,7 +98,7 @@ read_buf( char *bufp,
 			bufp += mbufsz;
 		}
 		bufsz -= mbufsz;
-		nread += ( intgen_t )mbufsz;
+		nread += ( int )mbufsz;
 		( * return_read_buf_funcp )( contextp, mbufp, mbufsz );
 	}
 
@@ -116,24 +116,24 @@ char
 	return rval;
 }
 
-intgen_t
+int
 bigstat_iter( jdm_fshandle_t *fshandlep,
-	      intgen_t fsfd,
-	      intgen_t selector,
+	      int fsfd,
+	      int selector,
 	      xfs_ino_t start_ino,
 	      bstat_cbfp_t fp,
 	      void * cb_arg1,
 	      bstat_seekfp_t seekfp,
 	      void * seek_arg1,
-	      intgen_t *statp,
+	      int *statp,
 	      bool_t ( pfp )( int ),
 	      xfs_bstat_t *buf,
 	      size_t buflenin )
 {
 	__s32 buflenout;
 	xfs_ino_t lastino;
-	intgen_t saved_errno;
-	intgen_t bulkstatcnt;
+	int saved_errno;
+	int bulkstatcnt;
         xfs_fsop_bulkreq_t bulkreq;
 
 	/* stat set with return from callback func
@@ -178,7 +178,7 @@ bigstat_iter( jdm_fshandle_t *fshandlep,
 		      buflenout,
 		      buf->bs_ino );
 		for ( p = buf, endp = buf + buflenout ; p < endp ; p++ ) {
-			intgen_t rval;
+			int rval;
 
 			if ( p->bs_ino == 0 )
 				continue;
@@ -253,13 +253,13 @@ bigstat_iter( jdm_fshandle_t *fshandlep,
 }
 
 /* ARGSUSED */
-intgen_t
-bigstat_one( intgen_t fsfd,
+int
+bigstat_one( int fsfd,
 	     xfs_ino_t ino,
 	     xfs_bstat_t *statp )
 {
         xfs_fsop_bulkreq_t bulkreq;
-	intgen_t count = 0;
+	int count = 0;
 
 	assert( ino > 0 );
         bulkreq.lastip = (__u64 *)&ino;
@@ -272,16 +272,16 @@ bigstat_one( intgen_t fsfd,
 /* call the given callback for each inode group in the filesystem.
  */
 #define INOGRPLEN	256
-intgen_t
-inogrp_iter( intgen_t fsfd,
-	     intgen_t ( * fp )( void *arg1,
-				intgen_t fsfd,
+int
+inogrp_iter( int fsfd,
+	     int ( * fp )( void *arg1,
+				int fsfd,
 				xfs_inogrp_t *inogrp ),
 	     void * arg1,
-	     intgen_t *statp )
+	     int *statp )
 {
 	xfs_ino_t lastino;
-	intgen_t inogrpcnt;
+	int inogrpcnt;
 	xfs_inogrp_t *igrp;
         xfs_fsop_bulkreq_t bulkreq;
 
@@ -311,7 +311,7 @@ inogrp_iter( intgen_t fsfd,
 			return 0;
 		}
 		for ( p = igrp, endp = igrp + inogrpcnt ; p < endp ; p++ ) {
-			intgen_t rval;
+			int rval;
 
 			rval = ( * fp )( arg1, fsfd, p );
 			if ( rval ) {
@@ -338,26 +338,26 @@ inogrp_iter( intgen_t fsfd,
  *
  * caller may supply a dirent buffer. if not, will malloc one
  */
-intgen_t
+int
 diriter( jdm_fshandle_t *fshandlep,
-	 intgen_t fsfd,
+	 int fsfd,
 	 xfs_bstat_t *statp,
-	 intgen_t ( *cbfp )( void *arg1,
+	 int ( *cbfp )( void *arg1,
 			     jdm_fshandle_t *fshandlep,
-			     intgen_t fsfd,
+			     int fsfd,
 			     xfs_bstat_t *statp,
 			     char *namep ),
 	 void *arg1,
-	 intgen_t *cbrvalp,
+	 int *cbrvalp,
 	 char *usrgdp,
 	 size_t usrgdsz )
 {
 	size_t gdsz;
 	struct dirent *gdp;
-	intgen_t fd;
-	intgen_t gdcnt;
-	intgen_t scrval;
-	intgen_t cbrval;
+	int fd;
+	int gdcnt;
+	int scrval;
+	int cbrval;
 
 	if ( usrgdp ) {
 		assert( usrgdsz >= sizeof( struct dirent ) );
@@ -392,7 +392,7 @@ diriter( jdm_fshandle_t *fshandlep,
 	cbrval = 0;
 	for ( gdcnt = 1 ; ; gdcnt++ ) {
 		struct dirent *p;
-		intgen_t nread;
+		int nread;
 		register size_t reclen;
 
 		assert( scrval == 0 );
@@ -426,7 +426,7 @@ diriter( jdm_fshandle_t *fshandlep,
 		      ;
 		      nread > 0
 		      ;
-		      nread -= ( intgen_t )reclen,
+		      nread -= ( int )reclen,
 		      assert( nread >= 0 ),
 		      p = ( struct dirent * )( ( char * )p + reclen ),
 		      reclen = ( size_t )p->d_reclen ) {
diff --git a/common/util.h b/common/util.h
index 8ac1831..5284811 100644
--- a/common/util.h
+++ b/common/util.h
@@ -33,9 +33,9 @@
  * if bufp is null, writes bufsz zeros.
  */
 typedef char * ( * gwbfp_t )( void *contextp, size_t wantedsz, size_t *szp);
-typedef intgen_t ( * wfp_t )( void *contextp, char *bufp, size_t bufsz );
+typedef int ( * wfp_t )( void *contextp, char *bufp, size_t bufsz );
 
-extern intgen_t write_buf( char *bufp,
+extern int write_buf( char *bufp,
 			   size_t bufsz,
 			   void *contextp,
 			   gwbfp_t get_write_buf_funcp,
@@ -56,15 +56,15 @@ extern intgen_t write_buf( char *bufp,
  * status of the first failure of the read funcp. if no read failures occur,
  * *statp will be zero.
  */
-typedef char * ( *rfp_t )( void *contextp, size_t wantedsz, size_t *szp, intgen_t *statp );
+typedef char * ( *rfp_t )( void *contextp, size_t wantedsz, size_t *szp, int *statp );
 typedef void ( * rrbfp_t )( void *contextp, char *bufp, size_t bufsz );
 
-extern intgen_t read_buf( char *bufp,
+extern int read_buf( char *bufp,
 			  size_t bufsz, 
 			  void *contextp,
 			  rfp_t read_funcp,
 			  rrbfp_t return_read_buf_funcp,
-			  intgen_t *statp );
+			  int *statp );
 
 
 
@@ -84,37 +84,37 @@ extern char *strncpyterm( char *s1, char *s2, size_t n );
 #define BIGSTAT_ITER_NONDIR	( 1 << 1 )
 #define BIGSTAT_ITER_ALL	( ~0 )
 
-typedef intgen_t (*bstat_cbfp_t)(void *arg1,
+typedef int (*bstat_cbfp_t)(void *arg1,
 				 jdm_fshandle_t *fshandlep,
-				 intgen_t fsfd,
+				 int fsfd,
 				 xfs_bstat_t *statp );
 
 typedef xfs_ino_t (*bstat_seekfp_t)(void *arg1,
 				    xfs_ino_t lastino);
 
-extern intgen_t bigstat_iter( jdm_fshandle_t *fshandlep,
-			      intgen_t fsfd,
-			      intgen_t selector,
+extern int bigstat_iter( jdm_fshandle_t *fshandlep,
+			      int fsfd,
+			      int selector,
 			      xfs_ino_t start_ino,
 			      bstat_cbfp_t fp,
 			      void * cb_arg1,
 			      bstat_seekfp_t seekfp,
 			      void * seek_arg1,
-			      intgen_t *statp,
+			      int *statp,
 			      bool_t ( pfp )( int ), /* preemption chk func */
 			      xfs_bstat_t *buf,
 			      size_t buflen );
 
-extern intgen_t bigstat_one( intgen_t fsfd,
+extern int bigstat_one( int fsfd,
 			     xfs_ino_t ino,
 			     xfs_bstat_t *statp );
 
-extern intgen_t inogrp_iter( intgen_t fsfd,
-			     intgen_t ( * fp )( void *arg1,
-				     		intgen_t fsfd,
+extern int inogrp_iter( int fsfd,
+			     int ( * fp )( void *arg1,
+				     		int fsfd,
 						xfs_inogrp_t *inogrp ),
 			     void * arg1,
-			     intgen_t *statp );
+			     int *statp );
 
 /* calls the callback for every entry in the directory specified
  * by the stat buffer. supplies the callback with a file system
@@ -129,16 +129,16 @@ extern intgen_t inogrp_iter( intgen_t fsfd,
  * callback's return value. if syscall fails, returns -1 with errno set.
  * otherwise returns 0.
  */
-extern intgen_t diriter( jdm_fshandle_t *fshandlep,
-			 intgen_t fsfd,
+extern int diriter( jdm_fshandle_t *fshandlep,
+			 int fsfd,
 			 xfs_bstat_t *statp,
-			 intgen_t ( *cbfp )( void *arg1,
+			 int ( *cbfp )( void *arg1,
 					     jdm_fshandle_t *fshandlep,
-					     intgen_t fsfd,
+					     int fsfd,
 					     xfs_bstat_t *statp,
 					     char *namep ),
 			 void *arg1,
-			 intgen_t *cbrvalp,
+			 int *cbrvalp,
 			 char *usrgdp,
 			 size_t usrgdsz );
 
diff --git a/dump/content.c b/dump/content.c
index 5d630bb..00a7bad 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -199,9 +199,9 @@ struct extent_group_context {
 	getbmapx_t eg_bmap[ BMAP_LEN ];
 	getbmapx_t *eg_nextbmapp;	/* ptr to the next extent to dump */
 	getbmapx_t *eg_endbmapp;		/* to detect extent exhaustion */
-	intgen_t eg_fd;			/* file desc. */
-	intgen_t eg_bmapix;		/* debug info only, not used */
-	intgen_t eg_gbmcnt;		/* debug, counts getbmapx calls for ino*/
+	int eg_fd;			/* file desc. */
+	int eg_bmapix;		/* debug info only, not used */
+	int eg_gbmcnt;		/* debug, counts getbmapx calls for ino*/
 };
 
 typedef struct extent_group_context extent_group_context_t;
@@ -266,11 +266,11 @@ static rv_t dump_dirs( ix_t strmix,
 		       void *inomap_contextp );
 static rv_t dump_dir( ix_t strmix,
 		      jdm_fshandle_t *,
-		      intgen_t,
+		      int,
 		      xfs_bstat_t * );
 static rv_t dump_file( void *,
 		       jdm_fshandle_t *,
-		       intgen_t,
+		       int,
 		       xfs_bstat_t * );
 static rv_t dump_file_reg( drive_t *drivep,
 			   context_t *contextp,
@@ -286,7 +286,7 @@ static rv_t dump_filehdr( drive_t *drivep,
 			  context_t *contextp,
 			  xfs_bstat_t *,
 			  off64_t,
-			  intgen_t );
+			  int );
 static rv_t dump_extenthdr( drive_t *drivep,
 			    context_t *contextp,
 			    int32_t,
@@ -336,7 +336,7 @@ static rv_t Media_mfile_end( drive_t *drivep,
 			     bool_t hit_eom );
 static bool_t Media_prompt_overwrite( drive_t *drivep );
 static rv_t Media_erasechk( drive_t *drivep,
-			    intgen_t dcaps,
+			    int dcaps,
 			    bool_t intr_allowed,
 			    bool_t prevmediapresentpr );
 static bool_t Media_prompt_erase( drive_t *drivep );
@@ -511,7 +511,7 @@ static bool_t create_inv_session(
 		size_t strmix);
 
 bool_t
-content_init( intgen_t argc,
+content_init( int argc,
 	      char *argv[ ],
 	      global_hdr_t *gwhdrtemplatep )
 {
@@ -544,10 +544,10 @@ content_init( intgen_t argc,
 	bool_t samepartialpr = BOOL_FALSE;
 	bool_t sameinterruptedpr = BOOL_FALSE;
 	size_t strmix;
-	intgen_t c;
-	intgen_t i;
-	intgen_t qstat;
-	intgen_t rval;
+	int c;
+	int i;
+	int qstat;
+	int rval;
 	bool_t ok;
 	extern char *optarg;
 	extern int optind, opterr, optopt;
@@ -1905,7 +1905,7 @@ create_inv_session(
 		ix_t subtreecnt,
 		size_t strmix)
 {
-	intgen_t rval;
+	int rval;
 	char *qmntpnt;
 	char *qfsdevice;
 
@@ -2086,7 +2086,7 @@ mark_callback( void *p, drive_markrec_t *dmp, bool_t committed )
 
 /* begin - called by stream process to invoke the dump stream
  */
-intgen_t
+int
 content_stream_dump( ix_t strmix )
 {
 	context_t *contextp = &sc_contextp[ strmix ];
@@ -2103,7 +2103,7 @@ content_stream_dump( ix_t strmix )
 	inv_stmtoken_t inv_stmt;
 	xfs_bstat_t *bstatbufp;
 	const size_t bstatbuflen = BSTATBUFLEN;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	/* sanity checks
@@ -2368,7 +2368,7 @@ content_stream_dump( ix_t strmix )
 					     ( void * )strmix,
 					     inomap_next_nondir,
 					     inomap_contextp,
-					     ( intgen_t * )&rv,
+					     ( int * )&rv,
 					     pipeline ?
 					       (bool_t (*)(int))preemptchk : 0,
 					     bstatbufp,
@@ -2563,7 +2563,7 @@ decision_more:
 			ok = inv_put_mediafile( inv_stmt,
 						&mwhdrp->mh_mediaid,
 						mwhdrp->mh_medialabel,
-					( u_intgen_t )mwhdrp->mh_mediafileix,
+					( u_int )mwhdrp->mh_mediafileix,
 						startino,
 						startoffset,
 						scwhdrp->cih_startpt.sp_ino,
@@ -2652,7 +2652,7 @@ content_complete( void )
 {
 	time_t elapsed;
 	bool_t completepr;
-	intgen_t i;
+	int i;
 
 	completepr = check_complete_flags( );
 
@@ -2769,7 +2769,7 @@ content_mediachange_query( void )
 static void
 update_cc_Media_useterminatorpr( drive_t *drivep, context_t *contextp )
 {
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 
 	contextp->cc_Media_useterminatorpr = BOOL_TRUE;
 	if ( ! ( dcaps & DRIVE_CAP_FILES )) {
@@ -2805,7 +2805,7 @@ dump_dirs( ix_t strmix,
 		xfs_bstat_t *p;
 		xfs_bstat_t *endp;
 		__s32 buflenout;
-		intgen_t rval;
+		int rval;
 
 		if ( bulkstatcallcnt == 0 ) {
 			mlog( MLOG_VERBOSE, _(
@@ -2909,17 +2909,17 @@ dump_dirs( ix_t strmix,
 static rv_t
 dump_dir( ix_t strmix,
 	  jdm_fshandle_t *fshandlep,
-	  intgen_t fsfd,
+	  int fsfd,
 	  xfs_bstat_t *statp )
 {
 	context_t *contextp = &sc_contextp[ strmix ];
 	drive_t *drivep = drivepp[ strmix ];
 	void *inomap_contextp = contextp->cc_inomap_contextp;
-	intgen_t state;
-	intgen_t fd;
+	int state;
+	int fd;
 	struct dirent *gdp = ( struct dirent *)contextp->cc_getdentsbufp;
 	size_t gdsz = contextp->cc_getdentsbufsz;
-	intgen_t gdcnt;
+	int gdcnt;
 	gen_t gen;
 	rv_t rv;
 
@@ -3008,7 +3008,7 @@ dump_dir( ix_t strmix,
 	 */
 	for ( gdcnt = 1, rv = RV_OK ; rv == RV_OK ; gdcnt++ ) {
 		struct dirent *p;
-		intgen_t nread;
+		int nread;
 		register size_t reclen;
 
 		nread = getdents_wrap( fd, (char *)gdp, gdsz );
@@ -3046,7 +3046,7 @@ dump_dir( ix_t strmix,
 		      ;
 		      nread > 0
 		      ;
-		      nread -= ( intgen_t )reclen,
+		      nread -= ( int )reclen,
 		      assert( nread >= 0 ),
 		      p = ( struct dirent * )( ( char * )p + reclen ),
 		      reclen = ( size_t )p->d_reclen ) {
@@ -3093,7 +3093,7 @@ dump_dir( ix_t strmix,
 			 */
 			if ( inomap_get_gen( NULL, p->d_ino, &gen) ) {
 				xfs_bstat_t statbuf;
-				intgen_t scrval;
+				int scrval;
 				
 				scrval = bigstat_one( fsfd,
 						      p->d_ino,
@@ -3261,7 +3261,7 @@ dump_extattr_list( drive_t *drivep,
 	char *dumpbufp;
 	char *endp;
 	size_t bufsz;
-	intgen_t rval = 0;
+	int rval = 0;
 	rv_t rv;
 	char *dumpbufendp = contextp->cc_extattrdumpbufp
 			    +
@@ -3645,7 +3645,7 @@ dump_extattrhdr( drive_t *drivep,
 {
 	extattrhdr_t ahdr;
 	extattrhdr_t tmpahdr;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
@@ -3693,7 +3693,7 @@ dump_extattrhdr( drive_t *drivep,
 static rv_t
 dump_file( void *arg1,
 	   jdm_fshandle_t *fshandlep,
-	   intgen_t fsfd,
+	   int fsfd,
 	   xfs_bstat_t *statp )
 {
 	ix_t strmix = ( ix_t )arg1;
@@ -3708,7 +3708,7 @@ dump_file( void *arg1,
 	startpt_t *startptp = &scwhdrp->cih_startpt;
 	startpt_t *endptp = &scwhdrp->cih_endpt;
 	bool_t file_skipped = BOOL_FALSE;
-	intgen_t state;
+	int state;
 	rv_t rv;
 
 	/* skip if no links
@@ -4147,7 +4147,7 @@ dump_file_spec( drive_t *drivep,
 		jdm_fshandle_t *fshandlep,
 		xfs_bstat_t *statp )
 {
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	mlog( MLOG_TRACE,
@@ -4178,7 +4178,7 @@ dump_file_spec( drive_t *drivep,
 	 * the symlink pathname char string will always  be NULL-terminated.
 	 */
 	if ( ( statp->bs_mode & S_IFMT ) == S_IFLNK ) {
-		intgen_t nread;
+		int nread;
 		size_t extentsz;
 
 		/* read the link path. if error, dump a zero-length
@@ -4263,7 +4263,7 @@ init_extent_group_context( jdm_fshandle_t *fshandlep,
 			   extent_group_context_t *gcp )
 {
 	bool_t isrealtime;
-	intgen_t oflags;
+	int oflags;
 	struct flock fl;
 
 	isrealtime = ( bool_t )(statp->bs_xflags & XFS_XFLAG_REALTIME );
@@ -4338,7 +4338,7 @@ dump_extent_group( drive_t *drivep,
 					XFS_XFLAG_REALTIME );
 	off64_t nextoffset;
 	off64_t bytecnt;	/* accumulates total bytes sent to media */
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	/*
@@ -4402,7 +4402,7 @@ dump_extent_group( drive_t *drivep,
 		 * get one.
 		 */
 		if ( gcp->eg_nextbmapp >= gcp->eg_endbmapp ) {
-			intgen_t entrycnt; /* entries in new bmap */
+			int entrycnt; /* entries in new bmap */
 
 			assert( gcp->eg_nextbmapp == gcp->eg_endbmapp );
 
@@ -4779,7 +4779,7 @@ dump_extent_group( drive_t *drivep,
 		 */
 		while ( extsz ) {
 			off64_t new_off;
-			intgen_t nread;
+			int nread;
 			size_t reqsz;
 			size_t actualsz;
 			char *bufp;
@@ -4947,12 +4947,12 @@ dump_filehdr( drive_t *drivep,
 	      context_t *contextp,
 	      xfs_bstat_t *statp,
 	      off64_t offset,
-	      intgen_t flags )
+	      int flags )
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	register filehdr_t *fhdrp = contextp->cc_filehdrp;
 	filehdr_t tmpfhdrp;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	( void )memset( ( void * )fhdrp, 0, sizeof( *fhdrp ));
@@ -5004,7 +5004,7 @@ dump_extenthdr( drive_t *drivep,
 	drive_ops_t *dop = drivep->d_opsp;
 	register extenthdr_t *ehdrp = contextp->cc_extenthdrp;
 	extenthdr_t tmpehdrp;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 	char typestr[20];
 
@@ -5079,7 +5079,7 @@ dump_dirent( drive_t *drivep,
 	size_t direntbufsz = contextp->cc_mdirentbufsz;
 	size_t sz;
 	size_t name_offset;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	if ( sc_use_old_direntpr ) {
@@ -5226,8 +5226,8 @@ dump_session_inv( drive_t *drivep,
 		uuid_t mediaid;
 		char medialabel[ GLOBAL_HDR_STRING_SZ ];
 		bool_t partial;
-		intgen_t mediafileix;
-		intgen_t rval;
+		int mediafileix;
+		int rval;
 		rv_t rv;
 
 		mlog( MLOG_VERBOSE, _(
@@ -5265,7 +5265,7 @@ dump_session_inv( drive_t *drivep,
 
 		uuid_copy(mediaid, mwhdrp->mh_mediaid);
 		strcpy( medialabel, mwhdrp->mh_medialabel );
-		mediafileix = ( intgen_t )mwhdrp->mh_mediafileix;
+		mediafileix = ( int )mwhdrp->mh_mediafileix;
 
 		rval = write_buf( inv_sbufp,
 				  inv_sbufsz,
@@ -5327,7 +5327,7 @@ dump_session_inv( drive_t *drivep,
 			ok = inv_put_mediafile( inv_stmt,
 						&mediaid,
 						medialabel,
-						( u_intgen_t )mediafileix,
+						( u_int )mediafileix,
 						(xfs_ino_t )0,
 						( off64_t )0,
 						(xfs_ino_t )0,
@@ -5444,7 +5444,7 @@ static rv_t
 write_pad( drive_t *drivep, size_t sz )
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	intgen_t rval;
+	int rval;
 	rv_t rv;
 
 	rval = write_buf( 0,
@@ -5531,7 +5531,7 @@ static rv_t
 Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	intgen_t dcaps = drivep->d_capabilities;
+	int dcaps = drivep->d_capabilities;
 	global_hdr_t *gwhdrp = drivep->d_gwritehdrp;
 	drive_hdr_t *dwhdrp = drivep->d_writehdrp;
 	media_hdr_t *mwhdrp = ( media_hdr_t * )dwhdrp->dh_upper;
@@ -5543,7 +5543,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 	bool_t prevmediapresentpr;
 	bool_t mediawrittentopr;
 	global_hdr_t saved_gwhdr;
-	intgen_t rval;
+	int rval;
 	bool_t ok;
 
 	/* sanity checks
@@ -5688,7 +5688,7 @@ position:
 				goto changemedia;
 			}
 			if ( MEDIA_TERMINATOR_CHK( mrhdrp )) {
-				intgen_t status;
+				int status;
 				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
 				      "stream terminator found\n") );
 				assert( contextp->cc_Media_useterminatorpr );
@@ -5745,7 +5745,7 @@ position:
 				      "unable to overwrite\n") );
 				goto changemedia;
 			} else {
-				intgen_t status;
+				int status;
 				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
 				      "repositioning to overwrite\n") );
 				assert( dcaps & DRIVE_CAP_BSF );
@@ -5879,7 +5879,7 @@ position:
 				mlog_exit_hint(RV_CORRUPT);
 				goto changemedia;
 			} else {
-				intgen_t status;
+				int status;
 				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA,_(
 				      "encountered corrupt or foreign data: "
 				      "repositioning to overwrite\n") );
@@ -6140,7 +6140,7 @@ Media_mfile_end( drive_t *drivep,
 		 bool_t hit_eom )
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	intgen_t rval;
+	int rval;
 
 	mlog( MLOG_DEBUG | MLOG_MEDIA,
 	      "Media op: end media file\n" );
@@ -6280,7 +6280,7 @@ retry:
 
 static rv_t
 Media_erasechk( drive_t *drivep,
-		intgen_t dcaps,
+		int dcaps,
 		bool_t intr_allowed,
 		bool_t prevmediapresentpr )
 {
diff --git a/dump/inomap.c b/dump/inomap.c
index dacf954..06f3869 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -69,7 +69,7 @@ extern bool_t allowexcludefiles_pr;
 
 /* inomap construction callbacks
  */
-static intgen_t cb_context( bool_t last,
+static int cb_context( bool_t last,
 			    time32_t,
 			    bool_t,
 			    time32_t,
@@ -77,24 +77,24 @@ static intgen_t cb_context( bool_t last,
 			    drange_t *,
 			    startpt_t *,
 			    size_t,
-			    intgen_t,
+			    int,
 			    bool_t,
 			    bool_t *);
 static void cb_context_free( void );
-static intgen_t cb_count_inogrp( void *, intgen_t, xfs_inogrp_t *);
-static intgen_t cb_add_inogrp( void *, intgen_t, xfs_inogrp_t * );
-static intgen_t cb_add( void *, jdm_fshandle_t *, intgen_t, xfs_bstat_t * );
+static int cb_count_inogrp( void *, int, xfs_inogrp_t *);
+static int cb_add_inogrp( void *, int, xfs_inogrp_t * );
+static int cb_add( void *, jdm_fshandle_t *, int, xfs_bstat_t * );
 static bool_t cb_inoinresumerange( xfs_ino_t );
 static bool_t cb_inoresumed( xfs_ino_t );
 static void cb_accuminit_sz( void );
 static void cb_spinit( void );
-static intgen_t cb_startpt( void *,
+static int cb_startpt( void *,
 			    jdm_fshandle_t *,
-			    intgen_t,
+			    int,
 			    xfs_bstat_t * );
-static intgen_t supprt_prune( void *,
+static int supprt_prune( void *,
 			      jdm_fshandle_t *,
-			      intgen_t,
+			      int,
 			      xfs_bstat_t *,
 			      char * );
 static off64_t quantity2offset( jdm_fshandle_t *, xfs_bstat_t *, off64_t );
@@ -102,25 +102,25 @@ static off64_t estimate_dump_space( xfs_bstat_t * );
 
 /* inomap primitives
  */
-static intgen_t inomap_init( intgen_t igrpcnt );
-static void inomap_add( void *, xfs_ino_t ino, gen_t gen, intgen_t );
-static intgen_t inomap_set_state( void *, xfs_ino_t ino, intgen_t );
+static int inomap_init( int igrpcnt );
+static void inomap_add( void *, xfs_ino_t ino, gen_t gen, int );
+static int inomap_set_state( void *, xfs_ino_t ino, int );
 static void inomap_set_gen(void *, xfs_ino_t, gen_t );
 
 /* subtree abstraction
  */
-static intgen_t subtree_descend_cb( void *,
+static int subtree_descend_cb( void *,
 				    jdm_fshandle_t *,
-				    intgen_t fsfd,
+				    int fsfd,
 				    xfs_bstat_t *,
 				    char * );
-static intgen_t subtreelist_parse_cb( void *,
+static int subtreelist_parse_cb( void *,
 				      jdm_fshandle_t *,
-				      intgen_t fsfd,
+				      int fsfd,
 				      xfs_bstat_t *,
 				      char * );
-static intgen_t subtreelist_parse( jdm_fshandle_t *,
-				   intgen_t,
+static int subtreelist_parse( jdm_fshandle_t *,
+				   int,
 				   xfs_bstat_t *,
 				   char *[],
 				   ix_t );
@@ -145,7 +145,7 @@ static u_int64_t inomap_exclude_skipattr = 0;
 /* ARGSUSED */
 bool_t
 inomap_build( jdm_fshandle_t *fshandlep,
-	      intgen_t fsfd,
+	      int fsfd,
 	      xfs_bstat_t *rootstatp,
 	      bool_t last,
 	      time32_t lasttime,
@@ -166,9 +166,9 @@ inomap_build( jdm_fshandle_t *fshandlep,
 	xfs_bstat_t *bstatbufp;
 	size_t bstatbuflen;
 	bool_t pruneneeded = BOOL_FALSE;
-	intgen_t igrpcnt = 0;
-	intgen_t stat;
-	intgen_t rval;
+	int igrpcnt = 0;
+	int stat;
+	int rval;
 
         /* do a sync so that bulkstat will pick up inode changes
          * that are currently in the inode cache. this is necessary
@@ -403,7 +403,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
 void
 inomap_skip( xfs_ino_t ino )
 {
-	intgen_t oldstate;
+	int oldstate;
 
 	oldstate = inomap_get_state( NULL, ino );
 	if ( oldstate == MAP_NDR_CHANGE) {
@@ -446,7 +446,7 @@ static bool_t cb_skip_unchanged_dirs;	/* set by cb_context() */
 /* cb_context - initializes the call back context for the add and prune
  * phases of inomap_build().
  */
-static intgen_t
+static int
 cb_context( bool_t last,
 	    time32_t lasttime,
 	    bool_t resume,
@@ -455,7 +455,7 @@ cb_context( bool_t last,
 	    drange_t *resumerangep,
 	    startpt_t *startptp,
 	    size_t startptcnt,
-	    intgen_t igrpcnt,
+	    int igrpcnt,
 	    bool_t skip_unchanged_dirs,
 	    bool_t *pruneneededp )
 {
@@ -489,10 +489,10 @@ cb_context_free( void )
 	inomap_free_context( cb_inomap_contextp );
 }
 
-static intgen_t
-cb_count_inogrp( void *arg1, intgen_t fsfd, xfs_inogrp_t *inogrp )
+static int
+cb_count_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
 {
-	intgen_t *count = (intgen_t *)arg1;
+	int *count = (int *)arg1;
 	(*count)++;
 	return 0;
 }
@@ -503,10 +503,10 @@ cb_count_inogrp( void *arg1, intgen_t fsfd, xfs_inogrp_t *inogrp )
  * files or directories have not been modified.
  */
 /* ARGSUSED */
-static intgen_t
+static int
 cb_add( void *arg1,
 	jdm_fshandle_t *fshandlep,
-	intgen_t fsfd,
+	int fsfd,
 	xfs_bstat_t *statp )
 {
 	register time32_t mtime = statp->bs_mtime.tv_sec;
@@ -692,12 +692,12 @@ cb_inoresumed( xfs_ino_t ino )
 static bool_t			/* false, used as diriter callback */
 supprt_prune( void *arg1,	/* ancestors marked as changed? */
 	      jdm_fshandle_t *fshandlep,
-	      intgen_t fsfd,
+	      int fsfd,
 	      xfs_bstat_t *statp,
 	      char *name )
 {
 	static bool_t cbrval = BOOL_FALSE;
-	intgen_t state;
+	int state;
 
 	if ( ( statp->bs_mode & S_IFMT ) == S_IFDIR ) {
 		bool_t changed_below = BOOL_FALSE;
@@ -810,13 +810,13 @@ typedef enum {
 } action_t;
 
 /* ARGSUSED */
-static intgen_t
+static int
 cb_startpt( void *arg1,
 	    jdm_fshandle_t *fshandlep,
-	    intgen_t fsfd,
+	    int fsfd,
 	    xfs_bstat_t *statp )
 {
-	register intgen_t state;
+	register int state;
 
 	off64_t estimate;
 	off64_t old_accum = cb_accum;
@@ -955,20 +955,20 @@ struct i2gseg {
 typedef struct i2gseg i2gseg_t;
 
 typedef struct seg_addr {
-	intgen_t hnkoff;
-	intgen_t segoff;
-	intgen_t inooff;
+	int hnkoff;
+	int segoff;
+	int inooff;
 } seg_addr_t;
 
 static struct inomap {
 	hnk_t *hnkmap;
-	intgen_t hnkmaplen;
+	int hnkmaplen;
 	i2gseg_t *i2gmap;
 	seg_addr_t lastseg;
 } inomap;
 
 static inline void
-SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, intgen_t state )
+SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
 {
 	register xfs_ino_t relino;
 	register u_int64_t mask;
@@ -1020,10 +1020,10 @@ SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, intgen_t state )
 	}
 }
 
-static inline intgen_t
+static inline int
 SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 {
-	intgen_t state;
+	int state;
 	register xfs_ino_t relino;
 	register u_int64_t mask;
 	relino = ino - segp->base;
@@ -1045,8 +1045,8 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 
 /* context for inomap construction - initialized by map_init
  */
-static intgen_t
-inomap_init( intgen_t igrpcnt )
+static int
+inomap_init( int igrpcnt )
 {
 	assert( sizeof( hnk_t ) == HNKSZ );
 
@@ -1072,7 +1072,7 @@ inomap_getsz( void )
 static inline bool_t
 inomap_validaddr( seg_addr_t *addrp )
 {
-	intgen_t maxseg;
+	int maxseg;
 
 	if ( addrp->hnkoff < 0 || addrp->hnkoff > inomap.lastseg.hnkoff )
 		return BOOL_FALSE;
@@ -1099,14 +1099,14 @@ inomap_addr2seg( seg_addr_t *addrp )
 	return &hunkp->seg[addrp->segoff];
 }
 
-static inline intgen_t
+static inline int
 inomap_addr2segix( seg_addr_t *addrp )
 {
 	return ( addrp->hnkoff * SEGPERHNK ) + addrp->segoff;
 }
 
-static inline intgen_t
-inomap_lastseg( intgen_t hnkoff )
+static inline int
+inomap_lastseg( int hnkoff )
 {
 	if ( hnkoff == inomap.lastseg.hnkoff )
 		return inomap.lastseg.segoff;
@@ -1117,8 +1117,8 @@ inomap_lastseg( intgen_t hnkoff )
 /* called for every inode group in the filesystem in increasing inode
  * order. adds a new segment to the inomap and ino-to-gen map.
  */
-static intgen_t
-cb_add_inogrp( void *arg1, intgen_t fsfd, xfs_inogrp_t *inogrp )
+static int
+cb_add_inogrp( void *arg1, int fsfd, xfs_inogrp_t *inogrp )
 {
 	hnk_t *hunk;
 	seg_t *segp;
@@ -1131,7 +1131,7 @@ cb_add_inogrp( void *arg1, intgen_t fsfd, xfs_inogrp_t *inogrp )
 		lastsegp->segoff = 0;
 
 		if (lastsegp->hnkoff == inomap.hnkmaplen) {
-			intgen_t numsegs;
+			int numsegs;
 
 			inomap.hnkmaplen++;
 			inomap.hnkmap = (hnk_t *)
@@ -1166,7 +1166,7 @@ cb_add_inogrp( void *arg1, intgen_t fsfd, xfs_inogrp_t *inogrp )
 /* called for every ino to be added to the map.
  */
 static void
-inomap_add( void *contextp, xfs_ino_t ino, gen_t gen, intgen_t state )
+inomap_add( void *contextp, xfs_ino_t ino, gen_t gen, int state )
 {
 	inomap_set_state( contextp, ino, state );
 	inomap_set_gen( contextp, ino, gen );
@@ -1203,8 +1203,8 @@ static bool_t
 inomap_find_hnk( seg_addr_t *addrp, xfs_ino_t ino )
 {
 	hnk_t *hunkp;
-	intgen_t lower;
-	intgen_t upper;
+	int lower;
+	int upper;
 
 	lower = 0;
 	upper = inomap.lastseg.hnkoff;
@@ -1235,8 +1235,8 @@ static bool_t
 inomap_find_seg( seg_addr_t *addrp, xfs_ino_t ino )
 {
 	seg_t *segp;
-	intgen_t lower;
-	intgen_t upper;
+	int lower;
+	int upper;
 
 	if ( !inomap_validaddr( addrp ) ) {
 		inomap_reset_context( addrp );
@@ -1267,7 +1267,7 @@ inomap_find_seg( seg_addr_t *addrp, xfs_ino_t ino )
 }
 
 static xfs_ino_t
-inomap_iter( void *contextp, intgen_t statemask )
+inomap_iter( void *contextp, int statemask )
 {
 	xfs_ino_t ino, endino;
 	seg_t *segp;
@@ -1286,7 +1286,7 @@ inomap_iter( void *contextp, intgen_t statemask )
 			ino = segp->base + addrp->inooff;
 			endino = segp->base + INOPERSEG;
 			for ( ; ino < endino ; ino++, addrp->inooff++ ) {
-				intgen_t st;
+				int st;
 				st = SEG_GET_BITS( segp, ino );
 				if ( statemask & ( 1 << st )) {
 					addrp->inooff++; /* for next call */
@@ -1302,7 +1302,7 @@ inomap_iter( void *contextp, intgen_t statemask )
 xfs_ino_t
 inomap_next_nondir(void *contextp, xfs_ino_t lastino)
 {
-	intgen_t state = 1 << MAP_NDR_CHANGE;
+	int state = 1 << MAP_NDR_CHANGE;
 	xfs_ino_t nextino;
 
 	do {
@@ -1315,7 +1315,7 @@ inomap_next_nondir(void *contextp, xfs_ino_t lastino)
 xfs_ino_t
 inomap_next_dir(void *contextp, xfs_ino_t lastino)
 {
-	intgen_t state = (1 << MAP_DIR_CHANGE) | (1 << MAP_DIR_SUPPRT);
+	int state = (1 << MAP_DIR_CHANGE) | (1 << MAP_DIR_SUPPRT);
 	xfs_ino_t nextino;
 
 	do {
@@ -1325,10 +1325,10 @@ inomap_next_dir(void *contextp, xfs_ino_t lastino)
 	return nextino;
 }
 
-static intgen_t
-inomap_set_state( void *contextp, xfs_ino_t ino, intgen_t state )
+static int
+inomap_set_state( void *contextp, xfs_ino_t ino, int state )
 {
-	intgen_t oldstate;
+	int oldstate;
 	seg_addr_t *addrp;
 	seg_addr_t addr;
 	seg_t *segp;
@@ -1345,7 +1345,7 @@ inomap_set_state( void *contextp, xfs_ino_t ino, intgen_t state )
 	return oldstate;
 }
 
-intgen_t
+int
 inomap_get_state( void *contextp, xfs_ino_t ino )
 {
 	seg_addr_t *addrp;
@@ -1382,7 +1382,7 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 	i2gsegp->s_gen[relino] = gen;
 }
 
-intgen_t
+int
 inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
 {
 	seg_addr_t *addrp;
@@ -1432,7 +1432,7 @@ inomap_dump( drive_t *drivep )
 	for ( addr.hnkoff = 0 ;
 	      addr.hnkoff <= inomap.lastseg.hnkoff ;
 	      addr.hnkoff++ ) {
-		intgen_t rval;
+		int rval;
 		rv_t rv;
 		drive_ops_t *dop = drivep->d_opsp;
 
@@ -1471,9 +1471,9 @@ inomap_dump( drive_t *drivep )
 	return RV_OK;
 }
 
-static intgen_t
+static int
 subtreelist_parse( jdm_fshandle_t *fshandlep,
-		   intgen_t fsfd,
+		   int fsfd,
 		   xfs_bstat_t *rootstatp,
 		   char *subtreebuf[],
 		   ix_t subtreecnt )
@@ -1487,7 +1487,7 @@ subtreelist_parse( jdm_fshandle_t *fshandlep,
 	/* do a recursive descent for each subtree specified
 	 */
 	for ( subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++ ) {
-		intgen_t cbrval = 0;
+		int cbrval = 0;
 		char *currentpath = subtreebuf[ subtreeix ];
 		assert( *currentpath != '/' );
 		( void )diriter( fshandlep,
@@ -1511,14 +1511,14 @@ subtreelist_parse( jdm_fshandle_t *fshandlep,
 	return 0;
 }
 
-static intgen_t
+static int
 subtreelist_parse_cb( void *arg1,
 		      jdm_fshandle_t *fshandlep,
-		      intgen_t fsfd,
+		      int fsfd,
 		      xfs_bstat_t *statp,
 		      char *name  )
 {
-	intgen_t cbrval = 0;
+	int cbrval = 0;
 
 	/* arg1 is used to carry the tail of the subtree path
 	 */
@@ -1594,14 +1594,14 @@ subtreelist_parse_cb( void *arg1,
 	}
 }
 
-static intgen_t
+static int
 subtree_descend_cb( void *arg1,
 		    jdm_fshandle_t *fshandlep,
-		    intgen_t fsfd,
+		    int fsfd,
 		    xfs_bstat_t *statp,
 		    char *name  )
 {
-	intgen_t cbrval = 0;
+	int cbrval = 0;
 
 	cb_add( NULL, fshandlep, fsfd, statp );
 
@@ -1628,7 +1628,7 @@ subtree_descend_cb( void *arg1,
 static off64_t
 quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
 {
-	intgen_t fd;
+	int fd;
 	getbmapx_t bmap[ BMAP_LEN ];
 	off64_t offset;
 	off64_t offset_next;
@@ -1661,8 +1661,8 @@ quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
 	}
 
 	for ( ; ; ) {
-		intgen_t eix;
-		intgen_t rval;
+		int eix;
+		int rval;
 
 		rval = ioctl( fd, XFS_IOC_GETBMAPX, bmap );
 		if ( rval ) {
diff --git a/dump/inomap.h b/dump/inomap.h
index 7d1db1f..663b434 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -47,7 +47,7 @@
  * abort the dump; else returns BOOL_TRUE.
  */
 extern bool_t inomap_build( jdm_fshandle_t *fshandlep,
-			    intgen_t fsfd,
+			    int fsfd,
 			    xfs_bstat_t *rootstatp,
 			    bool_t last,
 	      		    time32_t lasttime,
@@ -131,8 +131,8 @@ typedef struct hnk hnk_t;
 extern void *inomap_alloc_context( void );
 extern void inomap_reset_context( void *contextp );
 extern void inomap_free_context( void *contextp );
-extern intgen_t inomap_get_state( void *contextp, xfs_ino_t ino );
-extern intgen_t inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen );
+extern int inomap_get_state( void *contextp, xfs_ino_t ino );
+extern int inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen );
 
 
 /* generators returning the next dir or non-dir ino selected in this dump.
diff --git a/dump/var.c b/dump/var.c
index ceb7e3a..d3fa3be 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -84,7 +84,7 @@ void
 var_skip( uuid_t *dumped_fsidp, void ( *cb )( xfs_ino_t ino ))
 {
 	uuid_t fsid;
-	intgen_t rval;
+	int rval;
 
 	/* see if the fs uuid's match
 	 */
@@ -118,7 +118,7 @@ var_skip_recurse( char *base, void ( *cb )( xfs_ino_t ino ))
 	struct stat64 statbuf;
 	DIR *dirp;
 	struct dirent *direntp;
-	intgen_t rval;
+	int rval;
 
 	rval = lstat64( base, &statbuf );
 	if ( rval ) {
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index b564d2f..4c1855b 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -170,7 +170,7 @@ inv_writesession_open(
 {
 	invt_session_t  ses;
 	int		fd;
-	intgen_t	rval;
+	int	rval;
 	invt_sescounter_t *sescnt = NULL;
 	invt_seshdr_t  	hdr;
 	inv_sestoken_t	sestok;
@@ -867,10 +867,10 @@ static const char *myopts[] = {
 };
 
 
-intgen_t
+int
 inv_getopt(int argc, char **argv, invt_pr_ctx_t *prctx) 
 {
-	intgen_t rval = 0;
+	int rval = 0;
 	void *fs = 0;
 	char *options, *value;
 	extern char *optarg;
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 7020f7f..419f575 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -45,7 +45,7 @@
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 get_counters( int fd, void **cntpp, size_t cntsz )
 {
 	/* object must be locked at least SHARED by caller */
@@ -72,7 +72,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 			INV_VERSION );
 	} 
 
-	return (intgen_t) num;
+	return (int) num;
 }
 
 
@@ -83,7 +83,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
 /* get_headers                                                          */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
 {
 
@@ -110,7 +110,7 @@ get_headers( int fd, void **hdrs, size_t bufsz, size_t off )
 /* get_invtrecord                                                       */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, 
 	        int whence, bool_t dolock )
 {
@@ -153,7 +153,7 @@ get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 /* put_invtrecord                                                       */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, 
 	        int whence, bool_t dolock )
 {
@@ -193,7 +193,7 @@ put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
 /*----------------------------------------------------------------------*/
 
 
-intgen_t
+int
 get_headerinfo( int fd, void **hdrs, void **cnt,
 	        size_t hdrsz, size_t cntsz, bool_t dolock )
 {	
@@ -222,7 +222,7 @@ get_headerinfo( int fd, void **hdrs, void **cnt,
 /* get_lastheader                                                       */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 get_lastheader( int fd, void **ent, size_t hdrsz, size_t cntsz )
 {	
 	int	     	 nindices;
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 8263852..1c2bf3d 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -47,7 +47,7 @@
 /*----------------------------------------------------------------------*/
 
 
-intgen_t
+int
 fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 	      inv_oflag_t forwhat )
 {
@@ -86,7 +86,7 @@ fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs,
 /*----------------------------------------------------------------------*/
 
 
-intgen_t
+int
 fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 {
 	int numfs, i, fd;
@@ -172,7 +172,7 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
 
 
 
-intgen_t
+int
 fstab_get_fname( void *pred, 
 		 char *fname, 
 		 inv_predicate_t bywhat,
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 0378c5a..13b64db 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -153,7 +153,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 idx_put_newentry( 
 	invt_idxinfo_t *idx, 
 	invt_entry_t *ient )
@@ -291,7 +291,7 @@ idx_create( char *fname, inv_oflag_t forwhat )
 /*                                                                      */
 /*                                                                      */
 /*----------------------------------------------------------------------*/
-intgen_t
+int
 idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
 {
 	invt_timeperiod_t *tp = &idx->iarr[idx->index].ie_timeperiod;
@@ -316,7 +316,7 @@ idx_recons_time( time32_t tm, invt_idxinfo_t *idx )
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 {
 	int rval;
@@ -380,7 +380,7 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 idx_create_entry(  
 	inv_idbtoken_t *tok, 
 	int invfd, 	/* kept locked EX  by caller */
@@ -495,7 +495,7 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
 }
 
 
-intgen_t
+int
 idx_DEBUG_printinvindices( invt_entry_t *iarr, u_int num )
 {
 	u_int i;
@@ -520,7 +520,7 @@ idx_DEBUG_printinvindices( invt_entry_t *iarr, u_int num )
 	
 }
 
-intgen_t
+int
 idx_DEBUG_print ( int fd )
 {
 	int nindices;
@@ -542,7 +542,7 @@ idx_DEBUG_print ( int fd )
 
 
 
-intgen_t
+int
 DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, u_int ref,
 			  invt_pr_ctx_t *prctx)
 {
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index f1341b9..1b99d5c 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -220,7 +220,7 @@ invmgr_query_all_sessions (
 /* comparison/check.                                                    */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 search_invt( 
 	uuid_t			*fsidp,
 	int			invfd,
@@ -336,7 +336,7 @@ search_invt(
 /*---------------------------------------------------------------------------*/
 
 
-intgen_t
+int
 invmgr_inv_print(
 	int 		invfd, 
 	invt_pr_ctx_t 	*prctx)
@@ -427,7 +427,7 @@ invmgr_inv_print(
 /*---------------------------------------------------------------------------*/
 
 
-intgen_t
+int
 invmgr_inv_check(
 	int invfd)
 {
@@ -670,7 +670,7 @@ insert_session( invt_sessinfo_t *s)
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 make_invdirectory( inv_oflag_t forwhat )
 {
 	struct stat64 st;
diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
index ebcae95..66a03f4 100644
--- a/inventory/inv_oref.c
+++ b/inventory/inv_oref.c
@@ -29,12 +29,12 @@
 /*
  * Resolve a stobj, invidx or fstab
  */
-intgen_t
+int
 oref_resolve_(
 	invt_oref_t 	*obj,
 	invt_objtype_t	type)
 {
-	intgen_t rval;
+	int rval;
 
 	type &= INVT_OTYPE_MASK;
 	assert(type);
@@ -69,12 +69,12 @@ oref_resolve_(
  * Resolve an object reference upto a specified point 
  */
 
-intgen_t
+int
 oref_resolve_upto(
 	invt_oref_t 	*obj, 
 	invt_objtype_t	type)
 {
-	intgen_t rval = INV_OK;
+	int rval = INV_OK;
 
 	assert (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
 	assert (OREF_ISLOCKED(obj));
@@ -107,7 +107,7 @@ oref_resolve_upto(
 
 
 
-intgen_t
+int
 oref_resolve_entries(
 	invt_oref_t 	*obj)
 {
@@ -146,7 +146,7 @@ oref_resolve_entries(
 
 
 
-intgen_t
+int
 oref_resolve_counters(
 	invt_oref_t 	*obj)
 {
@@ -179,12 +179,12 @@ oref_resolve_counters(
 
 
 
-intgen_t
+int
 oref_sync(
 	invt_oref_t 	*obj, 
 	invt_objtype_t	type)
 {
-	intgen_t rval;
+	int rval;
 
 	type &= INVT_RES_MASK;
 	assert(type);
@@ -219,14 +219,14 @@ oref_sync(
 	return rval;
 }
 
-intgen_t
+int
 oref_sync_append(
 	invt_oref_t 	*obj, 
 	invt_objtype_t	type,
 	void		*entry,
 	size_t		entsz)
 {
-	intgen_t rval;
+	int rval;
 
 	type &= INVT_RES_MASK;
 	assert(type);
@@ -305,7 +305,7 @@ _oref_free(
  * Also resolves an idb_token as a side effect.
  */
 
-intgen_t
+int
 oref_resolve(
 	invt_oref_t	*invidx,
 	inv_predicate_t bywhat,
@@ -361,7 +361,7 @@ oref_resolve(
 	/* create another storage object ( and, an inv_index entry for it 
 	   too ) if we've filled this one up */
 	if (OREF_CNT_CURNUM(stobj) >= OREF_CNT_MAXNUM(stobj)) {
-		intgen_t 	rval;
+		int 	rval;
 #ifdef INVT_DEBUG
 		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
 		      "index entry. \n" );
@@ -390,7 +390,7 @@ oref_resolve(
  * Resolve the invidx entirely, and open the StObj.
  * Invidx is kept locked by caller
  */
-intgen_t
+int
 oref_resolve_child(
 	invt_oref_t 	*invidx,
 	int		*index)
@@ -424,7 +424,7 @@ oref_resolve_child(
 
 
 /* used to be idx_create */
-intgen_t
+int
 oref_resolve_new_invidx(
 	invt_oref_t 	*invidx,
 	char		*fname)
@@ -454,7 +454,7 @@ oref_resolve_new_invidx(
 
 
 /* formerly idx_create_entry() */
-intgen_t
+int
 oref_resolve_new_stobj(
 	invt_oref_t	*invidx,
 	bool_t		firstentry)
diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
index 2562500..e16684d 100644
--- a/inventory/inv_oref.h
+++ b/inventory/inv_oref.h
@@ -78,7 +78,7 @@ typedef struct invt_oref {
 
 	/* indicates level of depth this has been resolved to */
 	invt_objtype_t			 type;
-	intgen_t			 lockflag;
+	int			 lockflag;
 	void				 *token;
 } invt_oref_t;
 
@@ -231,22 +231,22 @@ typedef struct invt_oref {
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 oref_resolve(
 	invt_oref_t	*invidx,
 	inv_predicate_t bywhat,
 	void 		*pred);
 
-intgen_t
+int
 oref_resolve_upto(
 	invt_oref_t 	*obj, 
 	invt_objtype_t	type);
 
-intgen_t
+int
 oref_resolve_entries(
 	invt_oref_t 	*obj);
 
-intgen_t
+int
 oref_resolve_counters(
 	invt_oref_t 	*obj);
 
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 8817b5e..598c366 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -63,8 +63,8 @@
 #define INVLOCK( fd, m )	flock( fd, m ) 
 
 /* return values */
-#define INV_OK			(intgen_t) 1
-#define INV_ERR			(intgen_t) -1
+#define INV_OK			(int) 1
+#define INV_ERR			(int) -1
 
 #define I_DONE                  (int) -1
 #define I_EMPTYINV              (int) -2
@@ -356,10 +356,10 @@ typedef bool_t (*search_callback_t) (int, invt_seshdr_t *, void *, void *);
 inv_idbtoken_t
 idx_create( char *fname, inv_oflag_t forwhat );
 
-intgen_t
+int
 idx_create_entry( inv_idbtoken_t *tok, int invfd, bool_t firstentry );
 
-intgen_t
+int
 idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime);
 
 
@@ -370,19 +370,19 @@ u_int
 idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr, 
 		     invt_counter_t *icnt,
 		     time32_t tm );
-intgen_t
+int
 idx_put_newentry( invt_idxinfo_t *idx, invt_entry_t *ient );
 
 int
 idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index );
 
-intgen_t
+int
 idx_recons_time( time32_t tm, invt_idxinfo_t *idx );
 
-intgen_t
+int
 idx_DEBUG_printinvindices( invt_entry_t *iarr, u_int num );
 
-intgen_t
+int
 idx_DEBUG_print ( int fd );
 
 /*----------------------------------------------------------------------*/
@@ -390,11 +390,11 @@ idx_DEBUG_print ( int fd );
 int
 stobj_create( char *fname );
 
-intgen_t
+int
 stobj_create_session( inv_sestoken_t tok, int fd, invt_sescounter_t *sescnt, 
 		      invt_session_t *ses, invt_seshdr_t *hdr );
 
-intgen_t
+int
 stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf );
 
 off64_t
@@ -406,7 +406,7 @@ stobj_put_session(
 	invt_stream_t *strms,
 	invt_mediafile_t *mfiles );
 
-intgen_t
+int
 stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles );
@@ -414,20 +414,20 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 int
 stobj_hdrcmp( const void *h1, const void *h2 );
 
-intgen_t
+int
 stobj_sortheaders( int fd, u_int num );
 
 u_int
 stobj_find_splitpoint( int fd, invt_seshdr_t *harr, u_int ns, time32_t tm );
 
-intgen_t
+int
 stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt, 
 	     invt_sessinfo_t *newsess );
 bool_t
 stobj_replace_session( int fd, invt_sescounter_t *sescnt, invt_session_t *ses,
 		       invt_seshdr_t *hdr, invt_sessinfo_t *newsess );
 
-intgen_t
+int
 stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
 		    off64_t  mfileoff );
 
@@ -449,20 +449,20 @@ bool_t
 stobj_delete_mobj( int fd, invt_seshdr_t *hdr, void *arg,
 		   void **buf );
 
-intgen_t
+int
 stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr, invt_session_t *ses );
 
 void
 stobj_makefname( char *fname );
 
-intgen_t
+int
 stobj_insert_session( invt_idxinfo_t *idx, int fd,
 		      invt_sessinfo_t *s );
 
-intgen_t
+int
 stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr );
 
-intgen_t
+int
 stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
 		    inv_session_t **buf);
 
@@ -494,14 +494,14 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo);
 
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 fstab_get_fname( void *pred, char *fname, inv_predicate_t bywhat, 
 		 inv_oflag_t forwhat );
 
-intgen_t
+int
 fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat );
 
-intgen_t
+int
 fstab_getall( invt_fstab_t **arr, invt_counter_t **cnt, int *numfs, 
 	      inv_oflag_t forwhat );
 
@@ -511,13 +511,13 @@ fstab_DEBUG_print( invt_fstab_t *arr, int num );
 
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 get_invtentry( char *fname, time32_t tm, invt_entry_t *buf, size_t bufsz );
 
-intgen_t
+int
 get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, int, bool_t dolock );
 
-intgen_t
+int
 put_invtrecord( int fd, void *buf, size_t bufsz, off64_t off, int, bool_t dolock );
 
 inv_idbtoken_t
@@ -527,23 +527,23 @@ void
 destroy_token( inv_idbtoken_t tok );
 
 
-intgen_t
+int
 get_headers( int fd, void **hdrs, size_t bufsz, size_t cntsz );
 
-intgen_t
+int
 get_counters( int fd, void **cntpp, size_t sz );
 
-intgen_t
+int
 get_sescounters( int fd, invt_sescounter_t **cntpp );
 
-intgen_t
+int
 get_lastheader( int fd, void **ent, size_t hdrsz,  size_t cntsz );
 
 
 inv_sestoken_t
 get_sesstoken( inv_idbtoken_t tok );
 
-intgen_t
+int
 get_headerinfo( int fd, void **hdrs, void **cnt,
 	        size_t hdrsz, size_t cntsz, bool_t doblock );
 
@@ -551,13 +551,13 @@ bool_t
 invmgr_query_all_sessions(uuid_t *fsidp, void *inarg, void **outarg,
 			  search_callback_t func);
 
-intgen_t
+int
 search_invt(uuid_t *fsidp, int invfd, void *arg, void **buf,
 	    search_callback_t do_chkcriteria);
-intgen_t
+int
 invmgr_inv_print( int invfd, invt_pr_ctx_t *prctx);
 
-intgen_t
+int
 invmgr_inv_check( int invfd );
 
 bool_t
@@ -571,18 +571,18 @@ lastsess_level_lessthan( int fd, invt_seshdr_t *hdr,  void *arg,
 bool_t
 lastsess_level_equalto( int fd, invt_seshdr_t *hdr,  void *arg, void **buf );
 
-intgen_t
+int
 DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, u_int ref, 
 			  invt_pr_ctx_t *prctx);
 
-intgen_t
+int
 make_invdirectory( inv_oflag_t forwhat );
 
 bool_t
 init_idb( void *pred, inv_predicate_t bywhat, inv_oflag_t forwhat, 
 	 inv_idbtoken_t *tok );
 
-intgen_t
+int
 inv_getopt( int argc, char **argv, invt_pr_ctx_t *prctx);
 
 bool_t
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index bae2fc5..0b6aa45 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -47,7 +47,7 @@
 /* Used in reconstruction of the inventory. We add a session to this    */
 /* storage object whether or not it has reached its maximum.            */
 /*----------------------------------------------------------------------*/
-intgen_t
+int
 stobj_insert_session( invt_idxinfo_t *idx,
 		      int fd, /* kept locked EX by caller */
 		      invt_sessinfo_t *s )
@@ -160,7 +160,7 @@ stobj_find_splitpoint( int fd, invt_seshdr_t *harr, u_int ns, time32_t tm )
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt, 
 	     invt_sessinfo_t *newsess )
 {
@@ -269,7 +269,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 
 
 /* ARGSUSED */
-intgen_t
+int
 stobj_delete_mfile( int fd, inv_stream_t *strm, invt_mediafile_t *mf,
 		    off64_t  mfileoff )
 {
@@ -385,7 +385,7 @@ stobj_put_session(
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_sortheaders( int fd, u_int num )
 {
 	size_t sz = sizeof( invt_seshdr_t ) * num;
@@ -435,7 +435,7 @@ stobj_sortheaders( int fd, u_int num )
 /* after adjusting their offsets.                                       */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles )
@@ -567,7 +567,7 @@ stobj_create( char *fname )
 /*----------------------------------------------------------------------*/
 
 
-intgen_t
+int
 stobj_create_session( 
 	inv_sestoken_t tok, 
 	int fd, /* kept locked EX by caller */
@@ -601,7 +601,7 @@ stobj_create_session(
 /* The stobj_fd in the stream token is kept locked EX by caller.        */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 {
 	int  rval;
@@ -707,7 +707,7 @@ stobj_put_mediafile( inv_stmtoken_t tok, invt_mediafile_t *mf )
 /* caller takes the responsibility of locking.                          */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_get_sessinfo ( inv_sestoken_t tok, invt_seshdr_t *hdr, 
 		     invt_session_t *ses )
 {
@@ -1127,7 +1127,7 @@ stobj_unpack_sessinfo(
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_make_invsess( int fd, inv_session_t **buf, invt_seshdr_t *hdr )
 {
 	invt_session_t ses;
@@ -1206,7 +1206,7 @@ stobj_convert_session(inv_session_t *ises, invt_session_t *ses,
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 stobj_copy_invsess(int fd,  
 		   invt_seshdr_t *hdr,
 		   invt_session_t *ses,
diff --git a/inventory/inventory.h b/inventory/inventory.h
index 32156dd..43ac969 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -300,7 +300,7 @@ inv_delete_mediaobj( uuid_t *moid );
 extern bool_t
 inv_DEBUG_print( int argc, char **argv );
 
-extern intgen_t
+extern int
 inv_setup_base( void );
 
 extern char *
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 51b7774..7a268ea 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -84,7 +84,7 @@ typedef struct ses{
 
 #define SESLIM  240
 
-intgen_t
+int
 recons_test( int howmany )
 {
 	int fd, i, rval = 1;
@@ -120,7 +120,7 @@ recons_test( int howmany )
 
 
 
-intgen_t
+int
 delete_test( int n )
 {
 	int fd, i;
@@ -189,7 +189,7 @@ sess_queries_bylabel(char *lab)
 }
 
 
-intgen_t
+int
 query_test( int level )
 {
 	int i;
@@ -245,7 +245,7 @@ query_test( int level )
 /*                                                                      */
 /*----------------------------------------------------------------------*/
 
-intgen_t
+int
 write_test( int nsess, int nstreams, int nmedia, int dumplevel )
 {
 	int i,j,k,m,fd;
diff --git a/invutil/invidx.c b/invutil/invidx.c
index b6ce4fa..56995f0 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -621,7 +621,7 @@ stobj_create( char *fname )
     return fd;
 }
 
-intgen_t
+int
 stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses, 
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles )
diff --git a/restore/content.c b/restore/content.c
index b02e38a..ac7d72a 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -216,7 +216,7 @@ struct pers_file {
 		/* no non-dirs are needed from this nmedia file (due to
 		 * subtree or interactive selections)
 		 */
-	intgen_t f_flags;
+	int f_flags;
 		/* mark terminators and inventories
 		 */
 	bool_t f_underheadpr;
@@ -366,8 +366,8 @@ typedef struct partial_rest partial_rest_t;
 struct stream_context {
 	bstat_t    sc_bstat;
 	char       sc_path[2 * MAXPATHLEN];
-	intgen_t   sc_fd;
-	intgen_t   sc_hsmflags;
+	int   sc_fd;
+	int   sc_hsmflags;
 
 	/*
 	 * we have to set the owner before we set extended attributes otherwise
@@ -640,7 +640,7 @@ struct tran {
 	char *t_hkdir;
 		/* absolute pathname of housekeeping directory
 		 */
-	intgen_t t_persfd;
+	int t_persfd;
 		/* file descriptor of the persistent state file
 		 */
 	size64_t t_dirdumps;
@@ -793,7 +793,7 @@ static bool_t restore_reg( drive_t *drivep,
 static bool_t restore_extent_group( drive_t *drivep,
 				    filehdr_t *fhdrp,
 				    char *path,
-				    intgen_t fd,
+				    int fd,
 				    bool_t ehcs,
 				    rv_t *rvp);
 static bool_t restore_complete_reg( stream_context_t* );
@@ -825,9 +825,9 @@ static void addobj( bag_t *bagp,
 static size_t cntobj( bag_t *bagp );
 static bool_t gapneeded( egrp_t *firstegrpp, egrp_t *lastegrpp );
 static char * ehdr_typestr( int32_t type );
-static intgen_t egrpcmp( egrp_t *egrpap, egrp_t *egrpbp );
+static int egrpcmp( egrp_t *egrpap, egrp_t *egrpbp );
 static void display_dump_label( bool_t lockpr,
-				intgen_t mllevel,
+				int mllevel,
 				char *introstr,
 				global_hdr_t *grhdrp,
 				media_hdr_t *mrhdrp,
@@ -883,7 +883,7 @@ static bool_t mcflag[ STREAM_SIMMAX ]; /* media change flag */
 /* definition of locally defined global functions ****************************/
 
 bool_t
-content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
+content_init( int argc, char *argv[ ], size64_t vmsz )
 {
 	char *dstdir;	/* abs. path to destination dir */
 	bool_t cumpr;	/* cmd line cumulative restore specification */
@@ -906,9 +906,9 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 	ix_t descpgcnt; /* pages allocated for persistent descriptors */
 	struct stat statbuf;
 	pid_t pid;
-	intgen_t c;
+	int c;
 	bool_t ok;
-	intgen_t rval;
+	int rval;
 	bool_t fullpr;
 
 	/* Calculate the size needed for the persistent inventory 
@@ -1599,7 +1599,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 		char *path1;
 		char *path2;
 		rv_t rv;
-		intgen_t rval;
+		int rval;
 
 		path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
 		assert( path1 );
@@ -1914,7 +1914,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
 
 /* stream thread entry point - returns exit code
  */
-intgen_t
+int
 content_stream_restore( ix_t thrdix )
 {
 	dh_t fileh;
@@ -1922,7 +1922,7 @@ content_stream_restore( ix_t thrdix )
 	char *path1;
 	char *path2;
 	drive_t *drivep;
-	intgen_t dcaps;
+	int dcaps;
 	global_hdr_t *grhdrp;
 	drive_hdr_t *drhdrp;
 	media_hdr_t *mrhdrp;
@@ -1933,7 +1933,7 @@ content_stream_restore( ix_t thrdix )
 	uuid_t lastdumprejectedid;
 	rv_t rv;
 	bool_t ok;
-	intgen_t rval;
+	int rval;
 
 	/* allocate two path buffers
 	 */
@@ -2265,7 +2265,7 @@ content_stream_restore( ix_t thrdix )
 #if DEBUG_DUMPSTREAMS
 			{
 			    static int count[STREAM_MAX] = {0};
-			    intgen_t streamix = stream_getix( pthread_self() );
+			    int streamix = stream_getix( pthread_self() );
 			    if (++(count[streamix]) == 30) {
 				mlog( MLOG_TRACE,
 					"still waiting for dirs to be restored\n");
@@ -2437,7 +2437,7 @@ content_stream_restore( ix_t thrdix )
 #if DEBUG_DUMPSTREAMS
 			{
 			static int count[STREAM_MAX] = {0};
-			intgen_t streamix = stream_getix( pthread_self() );
+			int streamix = stream_getix( pthread_self() );
 			    if (++(count[streamix]) == 30) {
 				mlog( MLOG_NORMAL,
 				      "still waiting for dirs post-processing\n");
@@ -3453,7 +3453,7 @@ applynondirdump( drive_t *drivep,
 		drive_mark_t drivemark;
 		bstat_t *bstatp = &fhdrp->fh_stat;
 		bool_t resyncpr = BOOL_FALSE;
-		intgen_t rval;
+		int rval;
 
 		/* if a null file header, break
 		 */
@@ -3701,7 +3701,7 @@ wipepersstate( void )
 
 	while ( ( direntp = readdir64( dirp )) != 0 ) {
 		/* REFERENCED */
-		intgen_t len;
+		int len;
 		if ( ! strcmp( direntp->d_name, "." )) {
 			continue;
 		}
@@ -3870,7 +3870,7 @@ Media_mfile_next( Media_t *Mediap,
 	content_hdr_t *crhdrp = Mediap->M_crhdrp;
 	content_inode_hdr_t *scrhdrp = Mediap->M_scrhdrp;
 	dh_t fileh;
-	intgen_t rval = 0; /* no error by default */
+	int rval = 0; /* no error by default */
 	rv_t rv;
 	bool_t ok;
 	uuid_t prevmfiledumpid;
@@ -3949,7 +3949,7 @@ Media_mfile_next( Media_t *Mediap,
 		bool_t maybeholespr;
 		xfs_ino_t begino;
 		xfs_ino_t endino;
-		intgen_t dcaps = drivep->d_capabilities;
+		int dcaps = drivep->d_capabilities;
 		dh_t objh = DH_NULL;
 
 		emptypr = BOOL_FALSE;
@@ -4755,7 +4755,7 @@ newmedia:
 		/* eject media if drive not already empty
 		 */
 		if ( ! emptypr ) {
-			intgen_t dcaps = drivep->d_capabilities;
+			int dcaps = drivep->d_capabilities;
 			if ( purp == PURP_SEARCH ) {
 				if ( Mediap->M_pos == POS_USELESS ) {
 					mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
@@ -4929,7 +4929,7 @@ pi_allocdesc( dh_t *deschp )
 		ix_t descppg = pgsz / PERS_DESCSZ;
 		ix_t descix;
 		/* REFERENCED */
-		intgen_t rval;
+		int rval;
 
 		/* first unmap if any existing descriptors
 		 */
@@ -5007,7 +5007,7 @@ pi_insertfile( ix_t drivecnt,
 	       bool_t egrpvalpr,
 	       xfs_ino_t startino,
 	       off64_t startoffset,
-	       intgen_t flags,
+	       int flags,
 	       bool_t fileszvalpr,
 	       off64_t filesz )
 {
@@ -5428,9 +5428,9 @@ pi_addfile( Media_t *Mediap,
 			Mediap->M_pos = POS_ATNONDIR;
 			donepr = BOOL_FALSE;
 			while ( ! donepr ) {
-				intgen_t nread;
+				int nread;
 				drive_ops_t *dop = drivep->d_opsp;
-				intgen_t rval = 0;
+				int rval = 0;
 				nread = read_buf( bufp + buflen,
 						  bufszincr,
 						  ( void * )drivep,
@@ -5439,7 +5439,7 @@ pi_addfile( Media_t *Mediap,
 						  &rval );
 				switch( rval ) {
 				case 0:
-					assert( nread == ( intgen_t )bufszincr );
+					assert( nread == ( int )bufszincr );
 					buflen += ( size_t )nread;
 					bufsz += bufszincr;
 					bufp = ( char * )realloc(( void * )bufp,
@@ -6136,7 +6136,7 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
 	bool_t maybeobjmissingpr;
 	bool_t maybefilemissingpr;
 	dh_t lastobjaddedh;
-	intgen_t objlistlen;
+	int objlistlen;
 
 	/* no point in proceeding if pi not begun
 	 */
@@ -6315,7 +6315,7 @@ pi_neededobjs_dir_alloc( bool_t *knownholesprp, bool_t *maybeholesprp )
 	bool_t maybeobjmissingpr;
 	bool_t maybefilemissingpr;
 	dh_t lastobjaddedh;
-	intgen_t objlistlen;
+	int objlistlen;
 
 	bagp = bag_alloc( );
 	iterp = pi_iter_alloc( );
@@ -7380,7 +7380,7 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
 static int
 set_file_owner(
 	char		 *path,
-	intgen_t	 *fdp,
+	int	 *fdp,
 	stream_context_t *strcxtp)
 {
 	bstat_t		*bstatp = &strcxtp->sc_bstat;
@@ -7441,11 +7441,11 @@ restore_reg( drive_t *drivep,
 {
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	stream_context_t *strctxp = (stream_context_t *)drivep->d_strmcontextp;
-	intgen_t *fdp = &strctxp->sc_fd;
-	intgen_t rval;
+	int *fdp = &strctxp->sc_fd;
+	int rval;
 	struct fsxattr fsxattr;
 	struct stat64 stat;
-	intgen_t oflags;
+	int oflags;
 
 	if ( !path )
 		return BOOL_TRUE;
@@ -7567,7 +7567,7 @@ static bool_t
 restore_extent_group( drive_t *drivep,
 		      filehdr_t *fhdrp,
 		      char *path,
-		      intgen_t fd,
+		      int fd,
 		      bool_t ehcs,
 		      rv_t *rvp )
 {
@@ -7679,9 +7679,9 @@ restore_complete_reg(stream_context_t *strcxtp)
 {
 	bstat_t *bstatp = &strcxtp->sc_bstat;
 	char *path = strcxtp->sc_path;
-	intgen_t fd = strcxtp->sc_fd;
+	int fd = strcxtp->sc_fd;
 	struct utimbuf utimbuf;
-	intgen_t rval;
+	int rval;
 
 	// only applies to regular files
 	if (!S_ISREG((strcxtp->sc_bstat.bs_mode)))
@@ -7781,7 +7781,7 @@ restore_spec( filehdr_t *fhdrp, rv_t *rvp, char *path )
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	struct utimbuf utimbuf;
 	char *printstr;
-	intgen_t rval;
+	int rval;
 
 	if ( ! path ) {
 		return BOOL_TRUE;
@@ -7949,8 +7949,8 @@ restore_symlink( drive_t *drivep,
 	drive_ops_t *dop = drivep->d_opsp;
 	extenthdr_t ehdr;
 	char *scratch;
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	rv_t rv;
 	mode_t oldumask;
 
@@ -8087,8 +8087,8 @@ read_filehdr( drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs )
 	bstat_t *bstatp = &fhdrp->fh_stat;
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	filehdr_t tmpfh;
 
 	nread = read_buf( ( char * )&tmpfh,
@@ -8146,8 +8146,8 @@ read_extenthdr( drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs )
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	extenthdr_t tmpeh;
 
 	nread = read_buf( ( char * )&tmpeh,
@@ -8209,8 +8209,8 @@ read_dirent( drive_t *drivep,
 	global_hdr_t *grhdrp = drivep->d_greadhdrp;
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	direnthdr_t tmpdh;
 	char *namep;    // beginning of name following the direnthdr_t
 
@@ -8331,8 +8331,8 @@ read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	extattrhdr_t tmpah;
 
 	nread = read_buf( ( char * )&tmpah,
@@ -8364,8 +8364,8 @@ read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
 	mlog( MLOG_NITTY,
 	      "read extattr hdr sz %u valoff %u flags 0x%x valsz %u cs 0x%x\n",
 	      ahdrp->ah_sz,
-	      ( u_intgen_t )ahdrp->ah_valoff,
-	      ( u_intgen_t )ahdrp->ah_flags,
+	      ( u_int )ahdrp->ah_valoff,
+	      ( u_int )ahdrp->ah_flags,
 	      ahdrp->ah_valsz,
 	      ahdrp->ah_checksum );
 
@@ -8403,8 +8403,8 @@ discard_padding( size_t sz, drive_t *drivep )
 {
 	drive_ops_t *dop = drivep->d_opsp;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 
 	nread = read_buf( 0,
 			  sz,
@@ -8489,8 +8489,8 @@ restore_extent( filehdr_t *fhdrp,
 		char *bufp;
 		size_t req_bufsz;	/* requested bufsz */
 		size_t sup_bufsz;	/* supplied bufsz */
-		intgen_t nwritten;
-		intgen_t rval;
+		int nwritten;
+		int rval;
 		size_t ntowrite;
 
 		req_bufsz = ( size_t )min( ( off64_t )INTGENMAX, sz );
@@ -8549,7 +8549,7 @@ restore_extent( filehdr_t *fhdrp,
 			if ( fd != -1 ) {
 				size_t tries;
 				size_t remaining;
-				intgen_t rval;
+				int rval;
 				off64_t tmp_off;
 
 				rval = 0; /* for lint */
@@ -8558,7 +8558,7 @@ restore_extent( filehdr_t *fhdrp,
 				      remaining = ntowrite,
 				      tmp_off = off
 				      ;
-				      nwritten < ( intgen_t )ntowrite
+				      nwritten < ( int )ntowrite
 				      &&
 				      tries < WRITE_TRIES_MAX
 				      ;
@@ -8634,7 +8634,7 @@ restore_extent( filehdr_t *fhdrp,
 					}
 				}
 			} else {
-				nwritten = ( intgen_t )ntowrite;
+				nwritten = ( int )ntowrite;
 			}
 		} else {
 			nwritten = 0;
@@ -8664,7 +8664,7 @@ restore_extent( filehdr_t *fhdrp,
 			 */
 			fd = -1;
 			assert( ntowrite <= ( size_t )INTGENMAX );
-			nwritten = ( intgen_t )ntowrite;
+			nwritten = ( int )ntowrite;
 		}
 		sz -= ( off64_t )sup_bufsz;
 		off += ( off64_t )nwritten;
@@ -8737,8 +8737,8 @@ restore_extattr( drive_t *drivep,
 	for ( ; ; ) {
 		size_t recsz;
 		/* REFERENCED */
-		intgen_t nread;
-		intgen_t rval;
+		int nread;
+		int rval;
 		rv_t rv;
 
 		rv = read_extattrhdr( drivep, ahdrp, ahcs );
@@ -8775,7 +8775,7 @@ restore_extattr( drive_t *drivep,
 		default:
 			return RV_CORE;
 		}
-		assert( nread == ( intgen_t )( recsz - EXTATTRHDR_SZ ));
+		assert( nread == ( int )( recsz - EXTATTRHDR_SZ ));
 
 		if ( ! persp->a.restoreextattrpr && ! persp->a.restoredmpr ) {
 			continue;
@@ -8853,7 +8853,7 @@ setextattr( char *path, extattrhdr_t *ahdrp )
 	bool_t issecurepr = ahdrp->ah_flags & EXTATTRHDR_FLAGS_SECURE;
 	bool_t isdmpr;
 	int attr_namespace;
-	intgen_t rval;
+	int rval;
 
 	isdmpr = ( isrootpr &&
 		   !strncmp((char *)(&ahdrp[1]), dmiattr, sizeof(dmiattr)-1) );
@@ -8875,7 +8875,7 @@ setextattr( char *path, extattrhdr_t *ahdrp )
 	rval = attr_set( path,
 			 ( char * )( &ahdrp[ 1 ] ),
 			 ( ( char * )ahdrp ) + ( u_long_t )ahdrp->ah_valoff,
-			 ( intgen_t )ahdrp->ah_valsz,
+			 ( int )ahdrp->ah_valsz,
 			 attr_namespace | ATTR_DONTFOLLOW );
 	if ( rval ) {
 		char *namespace;
@@ -9291,7 +9291,7 @@ pi_show( char *introstring )
 {
 	char strbuf[ 100 ];
 	/* REFERENCED */
-	intgen_t strbuflen;
+	int strbuflen;
 	fold_t fold;
 
 	if ( mlog_level_ss[ MLOG_SS_MEDIA ] < MLOG_NITTY + 1 ) {
@@ -9323,7 +9323,7 @@ static void
 pi_show_nomloglock( void )
 {
 	dh_t strmh;
-	intgen_t strmix;
+	int strmix;
 
 
 	/* no point in proceeding if pi not begun
@@ -9345,7 +9345,7 @@ pi_show_nomloglock( void )
 	      ;
 	      strmh = DH2S( strmh )->s_nexth, strmix++ ) {
 		dh_t objh;
-		intgen_t objix;
+		int objix;
 
 		mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK | MLOG_MEDIA,
 		      _("\nmedia stream %u:\n"),
@@ -9503,7 +9503,7 @@ pi_show_nomloglock( void )
 	}
 }
 
-static intgen_t
+static int
 egrpcmp( egrp_t *egrpap, egrp_t *egrpbp )
 {
 	if ( egrpap->eg_ino < egrpbp->eg_ino ) {
@@ -9521,7 +9521,7 @@ egrpcmp( egrp_t *egrpap, egrp_t *egrpbp )
 
 static void
 display_dump_label( bool_t lockpr,
-		    intgen_t mllevel,
+		    int mllevel,
 		    char *introstr,
 		    global_hdr_t *grhdrp,
 		    media_hdr_t *mrhdrp,
diff --git a/restore/dirattr.c b/restore/dirattr.c
index a15abe5..d8d5140 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -261,7 +261,7 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
 		{
 		bool_t successpr;
 		unsigned int ioctlcmd;
-		intgen_t loglevel;
+		int loglevel;
 		size_t trycnt;
 
 		for ( trycnt = 0,
@@ -276,7 +276,7 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
 		      loglevel = max( MLOG_NORMAL, loglevel - 1 )) {
 			off64_t initsz;
 			struct flock64 flock64;
-			intgen_t rval;
+			int rval;
 
 			if ( ! ioctlcmd ) {
 				continue;
@@ -354,7 +354,7 @@ void
 dirattr_cleanup( void )
 {
 	/* REFERENCED */
-	intgen_t rval;
+	int rval;
 
 	if ( ! dtp ) {
 		return;
@@ -474,8 +474,8 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 	off64_t off;
 	off64_t seekoff;
 	off64_t nulloff;
-	intgen_t nread;
-	intgen_t nwritten;
+	int nread;
+	int nwritten;
 
 	/* pull the selected dir attributes into the cache
 	 */
@@ -527,7 +527,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 		nread = read( dtp->dt_extattrfd,
 			      ( void * )&off,
 			      sizeof( off ));
-		if ( nread != ( intgen_t )sizeof( off )) {
+		if ( nread != ( int )sizeof( off )) {
 			mlog( MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
@@ -558,7 +558,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 	nwritten = write( dtp->dt_extattrfd,
 			  ( void * )&nulloff,
 			  sizeof( nulloff ));
-	if ( nwritten != ( intgen_t )sizeof( nulloff )) {
+	if ( nwritten != ( int )sizeof( nulloff )) {
 		mlog( MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not write extended attributes "
 		      "file %s: "
@@ -570,7 +570,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 		return;
 	}
 	nwritten = write( dtp->dt_extattrfd, ( void * )ahdrp, ahdrp->ah_sz );
-	if ( nwritten != ( intgen_t )( ahdrp->ah_sz )) {
+	if ( nwritten != ( int )( ahdrp->ah_sz )) {
 		mlog( MLOG_NORMAL | MLOG_WARNING, _(
 		      "could not write at end of extended attributes "
 		      "file %s: "
@@ -605,7 +605,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
 		nwritten = write( dtp->dt_extattrfd,
 				  ( void * )&off,
 				  sizeof( off ));
-		if ( nwritten != ( intgen_t )sizeof( off )) {
+		if ( nwritten != ( int )sizeof( off )) {
 			mlog( MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not write extended attributes "
 			      "file %s: "
@@ -659,7 +659,7 @@ dirattr_cb_extattr( dah_t dah,
 	off = dtp->dt_cached_dirattr.d_extattroff;
 	while ( off != DIRATTR_EXTATTROFFNULL ) {
 		off64_t seekoff;
-		intgen_t nread;
+		int nread;
 		off64_t nextoff;
 		size_t recsz;
 		bool_t ok;
@@ -685,7 +685,7 @@ dirattr_cb_extattr( dah_t dah,
 		nread = read( dtp->dt_extattrfd,
 			      ( void * )&nextoff,
 			      sizeof( nextoff ));
-		if ( nread != ( intgen_t )sizeof( nextoff )) {
+		if ( nread != ( int )sizeof( nextoff )) {
 			mlog( MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
@@ -721,7 +721,7 @@ dirattr_cb_extattr( dah_t dah,
 		nread = read( dtp->dt_extattrfd,
 			      ( void * )&ahdrp[ 1 ],
 			      recsz - EXTATTRHDR_SZ );
-		if ( nread != ( intgen_t )( recsz - EXTATTRHDR_SZ )) {
+		if ( nread != ( int )( recsz - EXTATTRHDR_SZ )) {
 			mlog( MLOG_NORMAL | MLOG_WARNING, _(
 			      "could not read extended attributes "
 			      "file %s: "
@@ -758,7 +758,7 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 	off64_t argoff;
 	off64_t newoff;
 	dirattr_t dirattr;
-	intgen_t nwritten;
+	int nwritten;
 
 	/* sanity checks
 	 */
@@ -958,7 +958,7 @@ dirattr_get( dah_t dah )
 	dix_t dix;
 	off64_t argoff;
 	off64_t newoff;
-	intgen_t nread;
+	int nread;
 #ifdef DIRATTRCHK
 	u_int16_t sum;
 #endif /* DIRATTRCHK */
@@ -1040,7 +1040,7 @@ dirattr_cacheflush( void )
 #endif /* DIRATTRCHK */
 	off64_t argoff;
 	off64_t newoff;
-	intgen_t nwritten;
+	int nwritten;
 
 	/* sanity checks
 	 */
diff --git a/restore/inomap.c b/restore/inomap.c
index e5bcb55..f1604c4 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -77,8 +77,8 @@ extern size_t pgsz;
 
 /* inomap primitives
  */
-static intgen_t map_getset( xfs_ino_t, intgen_t, bool_t );
-static intgen_t map_set( xfs_ino_t ino, intgen_t );
+static int map_getset( xfs_ino_t, int, bool_t );
+static int map_set( xfs_ino_t ino, int );
 static seg_t * map_getsegment( xfs_ino_t ino );
 
 /* definition of locally defined global variables ****************************/
@@ -86,7 +86,7 @@ static seg_t * map_getsegment( xfs_ino_t ino );
 
 /* definition of locally defined static variables *****************************/
 
-static intgen_t pers_fd = -1;
+static int pers_fd = -1;
 	/* file descriptor for persistent inomap backing store
 	 */
 
@@ -103,7 +103,7 @@ static xfs_ino_t last_ino_added;
  */
 
 static inline void
-SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, intgen_t state )
+SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
 {
 	register xfs_ino_t relino;
 	register u_int64_t mask;
@@ -155,10 +155,10 @@ SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, intgen_t state )
 	}
 }
 
-static inline intgen_t
+static inline int
 SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 {
-	intgen_t state;
+	int state;
 	register xfs_ino_t relino;
 	register u_int64_t mask;
 	relino = ino - segp->base;
@@ -190,12 +190,12 @@ inomap_restore_pers( drive_t *drivep,
 	pers_t *persp;
 	hnk_t *pershnkp;
 	hnk_t *tmphnkp;
-	intgen_t fd;
+	int fd;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 	/* REFERENCED */
-	intgen_t rval1;
+	int rval1;
 	int i;
 	bool_t ok;
 
@@ -312,8 +312,8 @@ inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp )
 	drive_ops_t *dop = drivep->d_opsp;
 	u_int64_t tmphnkcnt;
 	/* REFERENCED */
-	intgen_t nread;
-	intgen_t rval;
+	int nread;
+	int rval;
 
 	/* get inomap info from media hdr
 	 */
@@ -411,7 +411,7 @@ inomap_sync_pers( char *hkdir )
 	 */
 	for ( hnkp = roothnkp
 	      ;
-	      hnkp < roothnkp + ( intgen_t )hnkcnt - 1
+	      hnkp < roothnkp + ( int )hnkcnt - 1
 	      ;
 	      hnkp++ ) {
 		hnkp->nextp = hnkp + 1;
@@ -422,7 +422,7 @@ inomap_sync_pers( char *hkdir )
 	 */
 	tailhnkp = hnkp;
 	assert( hnkcnt > 0 );
-	lastsegp = &tailhnkp->seg[ ( intgen_t )( segcnt
+	lastsegp = &tailhnkp->seg[ ( int )( segcnt
 						 -
 						 SEGPERHNK * ( hnkcnt - 1 )
 						 -
@@ -472,7 +472,7 @@ inomap_sanitize( void )
 			      ino < segp->base + INOPERSEG
 			      ;
 			      ino++ ) {
-				intgen_t state;
+				int state;
 				if ( ino > last_ino_added ) {
 					return;
 				}
@@ -552,7 +552,7 @@ begin:
 			return BOOL_FALSE;
 		}
 		for ( ino = segp->base ; ino < segp->base + INOPERSEG ; ino++ ){
-			intgen_t state;
+			int state;
 			if ( ino < firstino ) {
 				continue;
 			}
@@ -584,7 +584,7 @@ begin:
  * returns FALSE.
  */
 void
-inomap_cbiter( intgen_t statemask,
+inomap_cbiter( int statemask,
 	       bool_t ( * cbfunc )( void *ctxp, xfs_ino_t ino ),
 	       void *ctxp )
 {
@@ -612,7 +612,7 @@ inomap_cbiter( intgen_t statemask,
 			      ino < segp->base + INOPERSEG
 			      ;
 			      ino++ ) {
-				intgen_t state;
+				int state;
 				if ( ino > last_ino_added ) {
 					return;
 				}
@@ -634,10 +634,10 @@ inomap_cbiter( intgen_t statemask,
 /* map_getset - locates and gets the state of the specified ino,
  * and optionally sets the state to a new value.
  */
-static intgen_t
-map_getset( xfs_ino_t ino, intgen_t newstate, bool_t setflag )
+static int
+map_getset( xfs_ino_t ino, int newstate, bool_t setflag )
 {
-	intgen_t state;
+	int state;
 	seg_t *segp;
 
 	if ((segp = map_getsegment( ino )) == NULL) {
@@ -709,10 +709,10 @@ map_getsegment( xfs_ino_t ino )
 	return NULL;
 }
 
-static intgen_t
-map_set( xfs_ino_t ino, intgen_t state )
+static int
+map_set( xfs_ino_t ino, int state )
 {
-	intgen_t oldstate;
+	int oldstate;
 
  	oldstate = map_getset( ino, state, BOOL_TRUE );
 	return oldstate;
diff --git a/restore/inomap.h b/restore/inomap.h
index f208199..bc40f3e 100644
--- a/restore/inomap.h
+++ b/restore/inomap.h
@@ -79,7 +79,7 @@ extern bool_t inomap_rst_needed( xfs_ino_t begino, xfs_ino_t endino );
 extern void inomap_rst_add( xfs_ino_t ino );
 extern void inomap_rst_del( xfs_ino_t ino );
 extern rv_t inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp );
-extern void inomap_cbiter( intgen_t mapstatemask,
+extern void inomap_cbiter( int mapstatemask,
 			   bool_t ( * cbfunc )( void *ctxp, xfs_ino_t ino ),
 			   void *ctxp );
 
diff --git a/restore/namreg.c b/restore/namreg.c
index 18ba6d9..8c3b74f 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -176,7 +176,7 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
 		{
 		bool_t successpr;
 		unsigned int ioctlcmd;
-		intgen_t loglevel;
+		int loglevel;
 		size_t trycnt;
 
 		for ( trycnt = 0,
@@ -191,7 +191,7 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
 		      loglevel = max( MLOG_NORMAL, loglevel - 1 )) {
 			off64_t initsz;
 			struct flock64 flock64;
-			intgen_t rval;
+			int rval;
 
 			if ( ! ioctlcmd ) {
 				continue;
@@ -364,13 +364,13 @@ namreg_flush( void )
 	return RV_OK;
 }
 
-intgen_t
+int
 namreg_get( nrh_t nrh,
 	    char *bufp,
 	    size_t bufsz )
 {
 	off64_t newoff;
-	intgen_t nread;
+	int nread;
 	size_t len;
 	char *in_bufp;
 	static char read_buf[256];
@@ -479,7 +479,7 @@ namreg_get( nrh_t nrh,
 	
 	unlock( );
 
-	return ( intgen_t )len;
+	return ( int )len;
 }
 
 rv_t
diff --git a/restore/namreg.h b/restore/namreg.h
index 11004b6..8bc7b53 100644
--- a/restore/namreg.h
+++ b/restore/namreg.h
@@ -61,6 +61,6 @@ extern rv_t namreg_map( void );
  * small to fit the null-terminated name. return -2 if the name
  * not in the registry. return -3 if a system call fails.
  */
-extern intgen_t namreg_get( nrh_t nrh, char *bufp, size_t bufsz );
+extern int namreg_get( nrh_t nrh, char *bufp, size_t bufsz );
 
 #endif /* NAMREG_H */
diff --git a/restore/node.c b/restore/node.c
index 046f2f6..92a21ce 100644
--- a/restore/node.c
+++ b/restore/node.c
@@ -111,7 +111,7 @@ extern size_t pgmask;
  */
 #define NODE_HDRSZ	pgsz
 
-typedef intgen_t relnix_t;
+typedef int relnix_t;
 
 struct node_hdr {
 	size_t nh_nodesz;
@@ -144,7 +144,7 @@ struct node_hdr {
 	nh_t nh_virgnh;
 		/* handle of next virgin node
 		 */
-	intgen_t nh_segixshift;
+	int nh_segixshift;
 		/* bitshift used to extract the segment index from an nh_t
 		 */
 	relnix_t nh_relnixmask;
@@ -156,7 +156,7 @@ struct node_hdr {
 typedef struct node_hdr node_hdr_t;
 
 static node_hdr_t *node_hdrp;
-static intgen_t node_fd;
+static int node_fd;
 
 static inline segix_t
 nh2segix( nh_t nh )
@@ -227,7 +227,7 @@ node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
 
 /* ARGSUSED */
 bool_t
-node_init( intgen_t fd,
+node_init( int fd,
 	   off64_t off,
 	   size_t usrnodesz,
 	   ix_t nodehkix,
@@ -241,7 +241,7 @@ node_init( intgen_t fd,
 	size_t max_segments;
 	size_t winmapmax;
 	size_t segcount;
-	intgen_t segixshift;
+	int segixshift;
 
 	/* sanity checks
 	 */
@@ -395,7 +395,7 @@ node_init( intgen_t fd,
 }
 
 bool_t
-node_sync( intgen_t fd, off64_t off )
+node_sync( int fd, off64_t off )
 {
 	/* sanity checks
 	 */
@@ -472,7 +472,7 @@ node_alloc( void )
 	} else {
 		if ( nh2relnix( node_hdrp->nh_virgnh ) == 0 ) {
 			/* need to start a new virgin segment */
-			intgen_t rval;
+			int rval;
 			off64_t new_seg_off =
 				node_hdrp->nh_firstsegoff +
 				( off64_t )nh2segix( node_hdrp->nh_virgnh ) *
diff --git a/restore/node.h b/restore/node.h
index ba98d49..25fdaad 100644
--- a/restore/node.h
+++ b/restore/node.h
@@ -29,7 +29,7 @@ typedef size32_t nh_t;
 /* node_init - creates a new node abstraction.
  * user reserves one byte per node for use by the node abstraction
  */
-extern bool_t node_init( intgen_t fd,		/* backing store */
+extern bool_t node_init( int fd,		/* backing store */
 		         off64_t off,		/* offset into backing store */
 		         size_t nodesz,		/* node size */
 		         ix_t nodehkix,		/* my housekeeping byte */
@@ -39,7 +39,7 @@ extern bool_t node_init( intgen_t fd,		/* backing store */
 
 /* node_sync - syncs up with existing node abstraction persistent state
  */
-extern bool_t node_sync( intgen_t fd, off64_t off );
+extern bool_t node_sync( int fd, off64_t off );
 
 /* node_alloc - allocates a node, returning a handle.
  * returns NULL handle if no space left.
diff --git a/restore/tree.c b/restore/tree.c
index 98f6952..46ba715 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -156,7 +156,7 @@ struct tran {
 		/* if non-NULL, is path of hkdir relative to dstdir.
 		 * don't restore there.
 		 */
-	intgen_t t_persfd;
+	int t_persfd;
 		/* file descriptor of the persistent state file
 		 */
 	nh_t *t_hashp;
@@ -253,7 +253,7 @@ typedef struct link_iter_context link_iter_context_t;
  */
 struct path_cache {
 	nh_t nh;
-	intgen_t len;
+	int len;
 	char buf[MAXPATHLEN];
 };
 typedef struct path_cache path_cache_t;
@@ -275,8 +275,8 @@ static nh_t Node_alloc( xfs_ino_t ino,
 static void Node_free( nh_t *nhp );
 static node_t * Node_map( nh_t nh );
 static void Node_unmap( nh_t nh, node_t **npp );
-static intgen_t Node2path_recurse( nh_t nh, char *buf,
-				   intgen_t bufsz, intgen_t level );
+static int Node2path_recurse( nh_t nh, char *buf,
+				   int bufsz, int level );
 static void adopt( nh_t parh, nh_t cldh, nrh_t nrh );
 static nrh_t disown( nh_t cldh );
 static void selsubtree( nh_t nh, bool_t sensepr );
@@ -355,7 +355,7 @@ tree_init( char *hkdir,
 	off64_t nodeoff;
 	char *perspath;
 	bool_t ok;
-	intgen_t rval;
+	int rval;
 
 	/* sanity checks
 	 */
@@ -539,7 +539,7 @@ tree_sync( char *hkdir,
 	off64_t nodeoff;
 	char *perspath;
 	bool_t ok;
-	intgen_t rval;
+	int rval;
 
 	if ( persp ) {
 		return BOOL_TRUE;
@@ -874,7 +874,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
 			nh_t renameh;
 			node_t *renamep;
 			/* REFERENCED */
-			intgen_t namebuflen; 
+			int namebuflen; 
 
 			hardp->n_flags |= NF_REFED;
 			if ( hardp->n_parh == persp->p_orphh ) {
@@ -1283,7 +1283,7 @@ noref_elim_recurse( nh_t parh,
 		nh_t renameh;
 		nh_t grandcldh;
 		nh_t nextcldh;
-		intgen_t rval;
+		int rval;
 		bool_t ok;
 
 		cldp = Node_map( cldh );
@@ -1600,7 +1600,7 @@ mkdirs_recurse( nh_t parh, nh_t cldh, char *path )
 		/* if needed, create a directory and update real flag
 		 */
 		if ( isdirpr && ! isrealpr && isrefpr && isselpr ) {
-			intgen_t rval;
+			int rval;
 
 			if ( ! Node2path( cldh, path, _("makedir") )) {
 				cldh = nextcldh;
@@ -1674,7 +1674,7 @@ rename_dirs( nh_t cldh,
 
 		if ( isrenamepr ) {
 			node_t *renamep;
-			intgen_t rval;
+			int rval;
 			/* REFERENCED */
 			nrh_t dummynrh;
 			bool_t ok;
@@ -2015,8 +2015,8 @@ tree_adjref_recurse( nh_t cldh,
 		if ( ! pardumpedpr && parrefedpr ) {
 			cldp->n_flags |= NF_REFED;
 		}
-		clddumpedpr = ( intgen_t )cldp->n_flags & NF_DUMPEDDIR;
-		cldrefedpr = ( intgen_t )cldp->n_flags & NF_REFED;
+		clddumpedpr = ( int )cldp->n_flags & NF_DUMPEDDIR;
+		cldrefedpr = ( int )cldp->n_flags & NF_REFED;
 		grandcldh = cldp->n_cldh;
 		Node_unmap( cldh, &cldp  );
 	}
@@ -2177,7 +2177,7 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
 	nh_t nh;
 	link_iter_context_t link_iter_context;
 	bool_t ok;
-	intgen_t rval;
+	int rval;
 
 	/* skip directories
 	 */
@@ -2525,10 +2525,10 @@ setdirattr( dah_t dah, char *path )
 	mode_t mode;
 	struct utimbuf utimbuf;
 	struct fsxattr fsxattr;
-	intgen_t rval;
+	int rval;
 	size_t	hlen;
 	void	*hanp;
-	intgen_t fd = -1;
+	int fd = -1;
 
 	if ( dah == DAH_NULL )
 		return;
@@ -2642,7 +2642,7 @@ setdirattr( dah_t dah, char *path )
 bool_t
 tree_delorph( void )
 {
-	intgen_t rval;
+	int rval;
 
 	rval = rmdir( tranp->t_orphdir );
 	if ( rval ) {
@@ -2851,7 +2851,7 @@ tsi_cmd_pwd_recurse( void *ctxp,
 	node_t *np;
 	register nh_t parh;
 	/* REFERENCED */
-	register intgen_t namelen;
+	register int namelen;
 	nrh_t nrh;
 
 	assert( nh != NH_NULL );
@@ -2937,7 +2937,7 @@ tsi_cmd_ls( void *ctxp,
 		Node_unmap( cldh, &cldp );
 		if ( cldh != persp->p_orphh ) {
 			/* REFERENCED */
-			intgen_t namelen;
+			int namelen;
 			namelen = namreg_get( nrh,
 					      tranp->t_inter.i_name,
 					      sizeof( tranp->t_inter.i_name ));
@@ -3351,7 +3351,7 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
 			nh_t nextsibh;
 			nrh_t nrh;
 			/* REFERENCED */
-			intgen_t siblen;
+			int siblen;
 
 			sibp = Node_map( sibh );
 			nrh = sibp->n_nrh;
@@ -3484,7 +3484,7 @@ Node_unmap( nh_t nh, node_t **npp )
 static bool_t
 Node2path( nh_t nh, char *path, char *errmsg )
 {
-	intgen_t remainingcnt;
+	int remainingcnt;
 	strcpy(path, "."); /* in case root node passed in */
 	remainingcnt = Node2path_recurse( nh, path, MAXPATHLEN, 0 );
 	if ( remainingcnt <= 0 ) {
@@ -3509,8 +3509,8 @@ Node2path( nh_t nh, char *path, char *errmsg )
  * MAXPATHLEN. always null-terminates, but null char not counted in return.
  * works because the buffer size is secretly 2 * MAXPATHLEN.
  */
-static intgen_t
-Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
+static int
+Node2path_recurse( nh_t nh, char *buf, int bufsz, int level )
 {
 	static __thread path_cache_t cache = { NH_NULL, 0, "" };
 	node_t *np;
@@ -3519,8 +3519,8 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
 	gen_t gen;
 	nrh_t nrh;
 	char *oldbuf;
-	intgen_t oldbufsz;
-	intgen_t namelen;
+	int oldbufsz;
+	int namelen;
 
 	/* recursion termination
 	 */
@@ -3869,7 +3869,7 @@ link_matchh( nh_t hardh, nh_t parh, char *name )
 		np = Node_map( hardh );
 		if ( np->n_parh == parh ) {
 			/* REFERENCED */
-			intgen_t namelen;
+			int namelen;
 			namelen = namreg_get( np->n_nrh,
 					      tranp->t_namebuf,
 					      sizeof( tranp->t_namebuf ));
@@ -4462,7 +4462,7 @@ Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
 	}
 
 	if ( n.n_nrh != NRH_NULL ) {
-		intgen_t rval;
+		int rval;
 		rval = namreg_get( n.n_nrh, nambuf, sizeof( nambuf ));
 		assert( rval >= 0 );
 	}
@@ -4573,7 +4573,7 @@ tree_chk2_recurse( nh_t cldh, nh_t parh )
 		} else if ( cldh == persp->p_orphh ) {
 			sprintf( tranp->t_namebuf, "%llu.%u", ino, gen );
 		} else {
-			intgen_t namelen;
+			int namelen;
 			namelen = namreg_get( nrh,
 					      tranp->t_namebuf,
 					      sizeof( tranp->t_namebuf ));
diff --git a/restore/win.c b/restore/win.c
index 3ca2af8..e6c0be3 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -78,7 +78,7 @@ static void win_segmap_resize( segix_t segix );
 /* transient state
  */
 struct tran {
-	intgen_t t_fd;
+	int t_fd;
 		/* file descriptor of backing store to be windowed
 		 */
 	off64_t t_firstoff;
@@ -149,7 +149,7 @@ win_getnum_mmaps(void)
 }
 
 void
-win_init( intgen_t fd,
+win_init( int fd,
 	  off64_t firstoff,
 	  size64_t segsz,
 	  size_t winmax )
@@ -250,7 +250,7 @@ win_map( segix_t segix, void **pp )
 		tranp->t_wincnt++;
 	} else if ( tranp->t_lruheadp ) {
 		/* REFERENCED */
-		intgen_t rval;
+		int rval;
 #ifdef TREE_DEBUG
 		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
 		     "win_map(): get head from lru freelist & unmap\n");
diff --git a/restore/win.h b/restore/win.h
index 50d1dcc..a6bd002 100644
--- a/restore/win.h
+++ b/restore/win.h
@@ -21,11 +21,11 @@
 /* win.[ch] - windows into a very large file
  */
 
-typedef intgen_t segix_t;
+typedef int segix_t;
 
 /* initialize the window abstraction
  */
-void win_init( intgen_t fd,
+void win_init( int fd,
 	       off64_t rngoff,		/* offset into file of windowing */
 	       size64_t winsz,		/* window size */
 	       size_t wincntmax );	/* max number of windows to manage */
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/8] cleanup: kill u_int*_t types
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (2 preceding siblings ...)
  2015-10-16  1:44 ` [PATCH 3/8] cleanup: kill intgen_t Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-16  1:44 ` [PATCH 5/8] cleanup: define a local xfs_ino_t Dave Chinner
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

They are the same as uint*_t type defined in <stdint.h>, so seek and
destroy these to reduce the type proliferation issues that this code
has.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/content_inode.h  | 78 ++++++++++++++++++++++++-------------------------
 common/drive.h          |  4 +--
 common/drive_minrmt.c   | 56 +++++++++++++++++------------------
 common/drive_scsitape.c | 40 ++++++++++++-------------
 common/global.c         | 20 ++++++-------
 common/global.h         |  8 ++---
 common/hsmapi.c         | 10 +++----
 common/hsmapi.h         |  4 +--
 common/inventory.c      |  4 +--
 common/inventory.h      |  4 +--
 common/main.c           | 10 +++----
 common/media.h          | 10 +++----
 common/rec_hdr.h        |  4 +--
 common/types.h          | 17 +++++++----
 dump/content.c          | 66 ++++++++++++++++++++---------------------
 dump/inomap.c           | 30 +++++++++----------
 dump/inomap.h           |  8 ++---
 inventory/inv_api.c     |  6 ++--
 inventory/inv_core.c    |  4 +--
 inventory/inv_idx.c     | 18 ++++++------
 inventory/inv_mgr.c     |  4 +--
 inventory/inv_priv.h    | 32 ++++++++++----------
 inventory/inv_stobj.c   | 46 ++++++++++++++---------------
 inventory/inventory.h   | 12 ++++----
 inventory/testmain.c    |  2 +-
 invutil/invidx.c        |  6 ++--
 restore/content.c       | 20 ++++++-------
 restore/dirattr.c       | 54 +++++++++++++++++-----------------
 restore/dirattr.h       | 12 ++++----
 restore/inomap.c        | 24 +++++++--------
 restore/inomap.h        |  6 ++--
 restore/namreg.c        |  2 +-
 restore/namreg.h        |  2 +-
 restore/tree.c          |  6 ++--
 restore/tree.h          |  4 +--
 35 files changed, 319 insertions(+), 314 deletions(-)

diff --git a/common/content_inode.h b/common/content_inode.h
index 9013ca4..a69a9a0 100644
--- a/common/content_inode.h
+++ b/common/content_inode.h
@@ -88,19 +88,19 @@ struct content_inode_hdr {
 		/* starting point of media file contents */
 	startpt_t cih_endpt;				/*  18  70 */
 		/* starting point of next stream */
-	u_int64_t cih_inomap_hnkcnt;			/*   8  78 */
+	uint64_t cih_inomap_hnkcnt;			/*   8  78 */
 
-	u_int64_t cih_inomap_segcnt;			/*   8  80 */
+	uint64_t cih_inomap_segcnt;			/*   8  80 */
 
-	u_int64_t cih_inomap_dircnt;			/*   8  88 */
+	uint64_t cih_inomap_dircnt;			/*   8  88 */
 
-	u_int64_t cih_inomap_nondircnt;			/*   8  90 */
+	uint64_t cih_inomap_nondircnt;			/*   8  90 */
 
 	xfs_ino_t cih_inomap_firstino;			/*   8  98 */
 
 	xfs_ino_t cih_inomap_lastino;			/*   8  a0 */
 
-	u_int64_t cih_inomap_datasz;			/*   8  a8 */
+	uint64_t cih_inomap_datasz;			/*   8  a8 */
 		/* bytes of non-metadata dumped */
 	char cih_pad2[ CONTENT_INODE_HDR_SZ - 0xa8 ];	/*  18  c0 */
 		/* padding */
@@ -158,27 +158,27 @@ typedef struct timestruct timestruct_t;
 
 struct bstat {				/*		     bytes accum */
 	xfs_ino_t	bs_ino;		/* inode number		 8     8 */
-	u_int32_t	bs_mode;	/* type and mode	 4     c */
-	u_int32_t	bs_nlink;	/* number of links	 4    10 */
+	uint32_t	bs_mode;	/* type and mode	 4     c */
+	uint32_t	bs_nlink;	/* number of links	 4    10 */
 	int32_t		bs_uid;		/* user id		 4    14 */
 	int32_t		bs_gid;		/* group id		 4    18 */
-	u_int32_t	bs_rdev;	/* device value		 4    1c */
+	uint32_t	bs_rdev;	/* device value		 4    1c */
 	int32_t		bs_blksize;	/* block size		 4    20 */
 	off64_t		bs_size;	/* file size		 8    28 */
 	timestruct_t	bs_atime;	/* access time		 8    30 */
 	timestruct_t	bs_mtime;	/* modify time		 8    38 */
 	timestruct_t	bs_ctime;	/* inode change time	 8    40 */
 	int64_t		bs_blocks;	/* number of blocks	 8    48 */
-	u_int32_t	bs_xflags;	/* extended flags	 4    4c */
+	uint32_t	bs_xflags;	/* extended flags	 4    4c */
 	int32_t		bs_extsize;	/* extent size		 4    50 */
 	int32_t		bs_extents;	/* number of extents	 4    54 */
-	u_int32_t	bs_gen;		/* generation count	 4    58 */
-	u_int16_t	bs_projid_lo;	/* low 16 of project id	 2    5a */
-	u_int16_t	bs_forkoff;	/* inode fork offset	 2    5c */
-	u_int16_t	bs_projid_hi;	/* hi 16 of project id	 2    5e */
+	uint32_t	bs_gen;		/* generation count	 4    58 */
+	uint16_t	bs_projid_lo;	/* low 16 of project id	 2    5a */
+	uint16_t	bs_forkoff;	/* inode fork offset	 2    5c */
+	uint16_t	bs_projid_hi;	/* hi 16 of project id	 2    5e */
 	char		bs_pad[ 10 ];	/* for expansion	 e    68 */
-	u_int32_t	bs_dmevmask;	/* DMI event mask        4    6c */
-	u_int16_t	bs_dmstate;	/* DMI state info        2    6e */
+	uint32_t	bs_dmevmask;	/* DMI event mask        4    6c */
+	uint16_t	bs_dmstate;	/* DMI state info        2    6e */
 	char		bs_pad1[ 18 ];	/* for expansion        12    80 */
 					/* NOTE: old dumps didn't always
 					 * zero first 2 bytes of bs_pad1 */
@@ -216,12 +216,12 @@ bstat_projid(struct bstat *bs)
 struct filehdr {
 	int64_t fh_offset;
 	int32_t fh_flags;
-	u_int32_t fh_checksum;
+	uint32_t fh_checksum;
 	bstat_t fh_stat;
 	char fh_pad2[ FILEHDR_SZ
 		      - sizeof( int64_t )
 		      - sizeof( int32_t )
-		      - sizeof( u_int32_t )
+		      - sizeof( uint32_t )
 		      - sizeof( bstat_t ) ];
 };
 
@@ -260,7 +260,7 @@ struct extenthdr {
 	off64_t eh_offset;
 	int32_t eh_type;
 	int32_t eh_flags;
-	u_int32_t eh_checksum;
+	uint32_t eh_checksum;
 	char eh_pad[ 4 ];
 };
 
@@ -298,7 +298,7 @@ typedef struct extenthdr extenthdr_t;
  * a sequence of directory entries is always terminated with a null direnthdr_t.
  * this is detected by looking for a zero ino.
  */
-typedef u_int32_t gen_t;
+typedef uint32_t gen_t;
 
 #define DIRENTHDR_ALIGN	8
 
@@ -307,8 +307,8 @@ typedef u_int32_t gen_t;
 struct direnthdr {
 	xfs_ino_t dh_ino;
 	gen_t dh_gen;
-	u_int32_t dh_checksum;
-	u_int16_t dh_sz; /* overall size of record */
+	uint32_t dh_checksum;
+	uint16_t dh_sz; /* overall size of record */
 	char dh_name[ 6 ];
 };
 
@@ -320,9 +320,9 @@ typedef struct direnthdr direnthdr_t;
 
 struct direnthdr_v1 {
 	xfs_ino_t dh_ino;
-	u_int16_t dh_gen; /* generation count & DENTGENMASK of ref'ed inode */
-	u_int16_t dh_sz; /* overall size of record */
-	u_int32_t dh_checksum;
+	uint16_t dh_gen; /* generation count & DENTGENMASK of ref'ed inode */
+	uint16_t dh_sz; /* overall size of record */
+	uint32_t dh_checksum;
 	char dh_name[ 8 ];
 };
 
@@ -353,11 +353,11 @@ typedef struct direnthdr_v1 direnthdr_v1_t;
 #define EXTATTRHDR_ALIGN	8
 
 struct extattrhdr {
-	u_int32_t ah_sz; /* overall size of extended attribute record */
-	u_int16_t ah_valoff; /* byte offset within record of value */
-	u_int16_t ah_flags; /* see EXTATTRHDR_FLAGS_... below */
-	u_int32_t ah_valsz; /* size of value */
-	u_int32_t ah_checksum; /* hdr checksum */
+	uint32_t ah_sz; /* overall size of extended attribute record */
+	uint16_t ah_valoff; /* byte offset within record of value */
+	uint16_t ah_flags; /* see EXTATTRHDR_FLAGS_... below */
+	uint32_t ah_valsz; /* size of value */
+	uint32_t ah_checksum; /* hdr checksum */
 };
 
 typedef struct extattrhdr extattrhdr_t;
@@ -381,15 +381,15 @@ typedef struct extattrhdr extattrhdr_t;
 	 */
 
 /* Routines for calculating and validating checksums on xfsdump headers.
- * The header length must be an integral number of u_int32_t's.
+ * The header length must be an integral number of uint32_t's.
  */
-static inline u_int32_t
+static inline uint32_t
 calc_checksum(void *bufp, size_t len)
 {
-	u_int32_t sum = 0;
-	u_int32_t *sump = bufp;
-	u_int32_t *endp = sump + len / sizeof(u_int32_t);
-	assert(len % sizeof(u_int32_t) == 0);
+	uint32_t sum = 0;
+	uint32_t *sump = bufp;
+	uint32_t *endp = sump + len / sizeof(uint32_t);
+	assert(len % sizeof(uint32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
 	return ~sum + 1;
@@ -398,10 +398,10 @@ calc_checksum(void *bufp, size_t len)
 static inline bool_t
 is_checksum_valid(void *bufp, size_t len)
 {
-	u_int32_t sum = 0;
-	u_int32_t *sump = bufp;
-	u_int32_t *endp = sump + len / sizeof(u_int32_t);
-	assert(len % sizeof(u_int32_t) == 0);
+	uint32_t sum = 0;
+	uint32_t *sump = bufp;
+	uint32_t *endp = sump + len / sizeof(uint32_t);
+	assert(len % sizeof(uint32_t) == 0);
 	while (sump < endp)
 		sum += *sump++;
 	return sum == 0 ? BOOL_TRUE : BOOL_FALSE;
diff --git a/common/drive.h b/common/drive.h
index b0efa4c..89b143e 100644
--- a/common/drive.h
+++ b/common/drive.h
@@ -102,9 +102,9 @@
 #define DRIVE_HDR_SZ		sizeofmember( global_hdr_t, gh_upper )
 
 struct drive_hdr {
-	u_int32_t dh_drivecnt;				/*   4    4 */
+	uint32_t dh_drivecnt;				/*   4    4 */
 		/* number of drives used to dump the fs */
-	u_int32_t dh_driveix;				/*   4    8 */
+	uint32_t dh_driveix;				/*   4    8 */
 		/* 0-based index of the drive used to dump this stream */
 	int32_t dh_strategyid;				/*   4    c */
 		/* ID of the drive strategy used to produce this dump */
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 21eb09e..848d794 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -246,7 +246,7 @@ typedef struct drive_context drive_context_t;
 
 extern void usage( void );
 #ifdef DUMP
-extern u_int64_t hdr_mfilesz;
+extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
@@ -329,10 +329,10 @@ static int validate_media_file_hdr( drive_t *drivep );
 static void calc_max_lost( drive_t *drivep );
 static void display_ring_metrics( drive_t *drivep, int mlog_flags );
 #ifdef CLRMTAUD
-static u_int32_t rewind_and_verify( drive_t *drivep );
-static u_int32_t erase_and_verify( drive_t *drivep ); 
-static u_int32_t bsf_and_verify( drive_t *drivep );
-static u_int32_t fsf_and_verify( drive_t *drivep );
+static uint32_t rewind_and_verify( drive_t *drivep );
+static uint32_t erase_and_verify( drive_t *drivep ); 
+static uint32_t bsf_and_verify( drive_t *drivep );
+static uint32_t fsf_and_verify( drive_t *drivep );
 #else /* CLRMTAUD */
 static short rewind_and_verify( drive_t *drivep );
 static short erase_and_verify( drive_t *drivep ); 
@@ -399,7 +399,7 @@ static drive_ops_t drive_ops = {
 	do_quit,		/* do_quit */
 };
 
-static u_int32_t cmdlineblksize = 0;
+static uint32_t cmdlineblksize = 0;
 
 /* definition of locally defined global functions ****************************/
 
@@ -440,7 +440,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
 					c );
 				return -10;
 		    	    }
-			    cmdlineblksize = ( u_int32_t )atoi( optarg );
+			    cmdlineblksize = ( uint32_t )atoi( optarg );
 		            errno = 0;
 		            fd = open( drivep->d_pathname, O_RDONLY );
 		            if ( fd < 0 ) 
@@ -1003,13 +1003,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 */
 	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
 	if ( contextp->dc_recp ) {
-		u_int32_t recoff;
+		uint32_t recoff;
 #ifdef DEBUG
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
 		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( u_int32_t )( contextp->dc_nextp
+		recoff = ( uint32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
 		assert( recoff <= tape_recsz );
@@ -1032,7 +1032,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				+
 				( off64_t )rechdrp->rec_used;
 		if ( wantedoffset >= nextrecoffset ) {
-			u_int32_t recoff;
+			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
 			size_t actualcnt;
@@ -1048,7 +1048,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			/* figure how much to ask for
 			 */
 			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( u_int32_t )( contextp->dc_nextp
+			recoff = ( uint32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
 			wantedcnt = ( size_t )( rechdrp->rec_used
@@ -1232,11 +1232,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
 		wantedcnt = ( size_t )( wantedoffset - currentoffset );
 		if ( contextp->dc_recp ) {
-			u_int32_t recoff;
+			uint32_t recoff;
 #ifdef DEBUG
 			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
-			recoff = ( u_int32_t )( contextp->dc_nextp
+			recoff = ( uint32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
 			assert( recoff <= tape_recsz );
@@ -1269,13 +1269,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 */
 	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
 	if ( contextp->dc_recp ) {
-		u_int32_t recoff;
+		uint32_t recoff;
 #ifdef DEBUG
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
 		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( u_int32_t )( contextp->dc_nextp
+		recoff = ( uint32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
 		assert( recoff <= tape_recsz );
@@ -1522,7 +1522,7 @@ huntQIC:
 	      p < contextp->dc_recendp
 	      ;
 	      p += QIC_BLKSZ ) {
-		if ( *( u_int64_t * )p == STAPE_MAGIC ) {
+		if ( *( uint64_t * )p == STAPE_MAGIC ) {
 			goto adjustQIC;
 		}
 	}
@@ -2921,10 +2921,10 @@ static void
 tape_rec_checksum_set( drive_context_t *contextp, char *bufp )
 {
 	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	u_int32_t *beginp = ( u_int32_t * )bufp;
-	u_int32_t *endp = ( u_int32_t * )( bufp + tape_recsz );
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )bufp;
+	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	uint32_t *p;
+	uint32_t accum;
 
 	if ( ! contextp->dc_recchksumpr ) {
 		return;
@@ -2943,10 +2943,10 @@ static bool_t
 tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
 {
 	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	u_int32_t *beginp = ( u_int32_t * )bufp;
-	u_int32_t *endp = ( u_int32_t * )( bufp + tape_recsz );
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )bufp;
+	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	uint32_t *p;
+	uint32_t accum;
 
 	if ( contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT) ) {
 		accum = 0;
@@ -3886,7 +3886,7 @@ display_ring_metrics( drive_t *drivep, int mlog_flags )
 }
 
 #ifdef CLRMTAUD
-static u_int32_t
+static uint32_t
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
@@ -3913,7 +3913,7 @@ rewind_and_verify( drive_t *drivep )
 }
 
 #ifdef CLRMTAUD
-static u_int32_t
+static uint32_t
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
@@ -3945,7 +3945,7 @@ erase_and_verify( drive_t *drivep )
 }
 
 #ifdef CLRMTAUD
-static u_int32_t
+static uint32_t
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
@@ -3957,7 +3957,7 @@ bsf_and_verify( drive_t *drivep )
 }
 
 #ifdef CLRMTAUD
-static u_int32_t
+static uint32_t
 #else /* CLRMTAUD */
 static short
 #endif /* CLRMTAUD */
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 605675f..06ba2f4 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -288,7 +288,7 @@ typedef long mtstat_t;
 
 extern void usage( void );
 #ifdef DUMP
-extern u_int64_t hdr_mfilesz;
+extern uint64_t hdr_mfilesz;
 #endif /* DUMP */
 
 /* remote tape protocol declarations (should be a system header file)
@@ -446,7 +446,7 @@ static drive_ops_t drive_ops = {
 	do_quit,		/* do_quit */
 };
 
-static u_int32_t cmdlineblksize = 0;
+static uint32_t cmdlineblksize = 0;
 
 /* definition of locally defined global functions ****************************/
 
@@ -633,7 +633,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
 				    c );
 			    return -10;
 			}
-			cmdlineblksize = ( u_int32_t )atoi( optarg );
+			cmdlineblksize = ( uint32_t )atoi( optarg );
 			break;
 #ifdef DUMP
 		case GETOPT_OVERWRITE:
@@ -1116,13 +1116,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 */
 	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
 	if ( contextp->dc_recp ) {
-		u_int32_t recoff;
+		uint32_t recoff;
 #ifdef DEBUG
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
 		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( u_int32_t )( contextp->dc_nextp
+		recoff = ( uint32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
 		assert( recoff <= tape_recsz );
@@ -1145,7 +1145,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 				+
 				( off64_t )rechdrp->rec_used;
 		if ( wantedoffset >= nextrecoffset ) {
-			u_int32_t recoff;
+			uint32_t recoff;
 			size_t wantedcnt;
 			char *dummybufp;
 			size_t actualcnt;
@@ -1161,7 +1161,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 			/* figure how much to ask for
 			 */
 			assert( contextp->dc_nextp >= contextp->dc_recp );
-			recoff = ( u_int32_t )( contextp->dc_nextp
+			recoff = ( uint32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
 			wantedcnt = ( size_t )( rechdrp->rec_used
@@ -1345,11 +1345,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
 		wantedcnt = ( size_t )( wantedoffset - currentoffset );
 		if ( contextp->dc_recp ) {
-			u_int32_t recoff;
+			uint32_t recoff;
 #ifdef DEBUG
 			rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
-			recoff = ( u_int32_t )( contextp->dc_nextp
+			recoff = ( uint32_t )( contextp->dc_nextp
 						-
 						contextp->dc_recp );
 			assert( recoff <= tape_recsz );
@@ -1382,13 +1382,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
 	 */
 	currentoffset = contextp->dc_reccnt * ( off64_t )tape_recsz;
 	if ( contextp->dc_recp ) {
-		u_int32_t recoff;
+		uint32_t recoff;
 #ifdef DEBUG
 		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
 #endif
 
 		assert( contextp->dc_nextp >= contextp->dc_recp );
-		recoff = ( u_int32_t )( contextp->dc_nextp
+		recoff = ( uint32_t )( contextp->dc_nextp
 					-
 					contextp->dc_recp );
 		assert( recoff <= tape_recsz );
@@ -1665,7 +1665,7 @@ huntQIC:
 	      p < contextp->dc_recendp
 	      ;
 	      p += QIC_BLKSZ ) {
-		if ( *( u_int64_t * )p == STAPE_MAGIC ) {
+		if ( *( uint64_t * )p == STAPE_MAGIC ) {
 			goto adjustQIC;
 		}
 	}
@@ -3614,10 +3614,10 @@ static void
 tape_rec_checksum_set( drive_context_t *contextp, char *bufp )
 {
 	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	u_int32_t *beginp = ( u_int32_t * )bufp;
-	u_int32_t *endp = ( u_int32_t * )( bufp + tape_recsz );
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )bufp;
+	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	uint32_t *p;
+	uint32_t accum;
 
 	if ( ! contextp->dc_recchksumpr ) {
 		return;
@@ -3636,10 +3636,10 @@ static bool_t
 tape_rec_checksum_check( drive_context_t *contextp, char *bufp )
 {
 	rec_hdr_t *rechdrp = ( rec_hdr_t * )bufp;
-	u_int32_t *beginp = ( u_int32_t * )bufp;
-	u_int32_t *endp = ( u_int32_t * )( bufp + tape_recsz );
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )bufp;
+	uint32_t *endp = ( uint32_t * )( bufp + tape_recsz );
+	uint32_t *p;
+	uint32_t accum;
 
 	if ( contextp->dc_recchksumpr && INT_GET(rechdrp->ischecksum, ARCH_CONVERT)) {
 		accum = 0;
diff --git a/common/global.c b/common/global.c
index 2129941..ea7ad6d 100644
--- a/common/global.c
+++ b/common/global.c
@@ -96,7 +96,7 @@ global_hdr_alloc( int argc, char *argv[ ] )
 
 	/* fill in the host id: typecast to fit into a 64 bit field
 	 */
-	ghdrp->gh_ipaddr = ( u_int64_t )( unsigned long )gethostid( );
+	ghdrp->gh_ipaddr = ( uint64_t )( unsigned long )gethostid( );
 
 #ifdef DUMP
 	uuid_generate( ghdrp->gh_dumpid );
@@ -243,10 +243,10 @@ global_hdr_free( global_hdr_t *ghdrp )
 void
 global_hdr_checksum_set( global_hdr_t *hdrp )
 {
-	u_int32_t *beginp = ( u_int32_t * )&hdrp[ 0 ];
-	u_int32_t *endp = ( u_int32_t * )&hdrp[ 1 ];
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )&hdrp[ 0 ];
+	uint32_t *endp = ( uint32_t * )&hdrp[ 1 ];
+	uint32_t *p;
+	uint32_t accum;
 
 	hdrp->gh_checksum = 0;
 	accum = 0;
@@ -263,10 +263,10 @@ global_hdr_checksum_set( global_hdr_t *hdrp )
 bool_t
 global_hdr_checksum_check( global_hdr_t *hdrp )
 {
-	u_int32_t *beginp = ( u_int32_t * )&hdrp[ 0 ];
-	u_int32_t *endp = ( u_int32_t * )&hdrp[ 1 ];
-	u_int32_t *p;
-	u_int32_t accum;
+	uint32_t *beginp = ( uint32_t * )&hdrp[ 0 ];
+	uint32_t *endp = ( uint32_t * )&hdrp[ 1 ];
+	uint32_t *p;
+	uint32_t accum;
 
 	accum = 0;
 	for ( p = beginp ; p < endp ; p++ ) {
@@ -279,7 +279,7 @@ global_hdr_checksum_check( global_hdr_t *hdrp )
  * else return BOOL_FALSE
  */
 bool_t 
-global_version_check( u_int32_t version )
+global_version_check( uint32_t version )
 {
 	switch (version) {
 		case GLOBAL_HDR_VERSION_0:
diff --git a/common/global.h b/common/global.h
index 537be0c..0b738de 100644
--- a/common/global.h
+++ b/common/global.h
@@ -43,15 +43,15 @@
 struct global_hdr {
 	char gh_magic[ GLOBAL_HDR_MAGIC_SZ ];		/*   8    8 */
 		/* unique signature of xfsdump */
-	u_int32_t gh_version;				/*   4    c */
+	uint32_t gh_version;				/*   4    c */
 		/* header version */
-	u_int32_t gh_checksum;				/*   4   10 */
+	uint32_t gh_checksum;				/*   4   10 */
 		/* 32-bit unsigned additive inverse of entire header */
 	time32_t gh_timestamp;				/*   4   14 */
 		/* time32_t of dump */
 	char gh_pad1[ 4 ];				/*   4   18 */
 		/* alignment */
-	u_int64_t gh_ipaddr;				/*   8   20 */
+	uint64_t gh_ipaddr;				/*   8   20 */
 		/* from gethostid(2), room for expansion */
 	uuid_t gh_dumpid;				/*  10   30 */
 		/* ID of dump session	 */
@@ -97,7 +97,7 @@ extern bool_t global_hdr_checksum_check( global_hdr_t *hdrp );
  * else return BOOL_FALSE
  */
 
-extern bool_t global_version_check( u_int32_t version );
+extern bool_t global_version_check( uint32_t version );
 
 
 #endif /* GLOBAL_H */
diff --git a/common/hsmapi.c b/common/hsmapi.c
index ed29370..489223d 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -137,7 +137,7 @@ typedef	struct	{
 static inline void
 msb_store(
 	u_char		*dest,
-	u_int64_t	src,
+	uint64_t	src,
 	int		length)
 {
         int             i;
@@ -155,12 +155,12 @@ msb_store(
 * Returns
 *	value
 ******************************************************************************/
-static inline u_int64_t
+static inline uint64_t
 msb_load(
 	u_char		*src,
 	int		length)
 {
-        u_int64_t        tmp = 0;
+        uint64_t        tmp = 0;
         int             i;
 
         for (i = 0; i < length; i++) {
@@ -634,7 +634,7 @@ extern int
 HsmFilterExistingAttribute(
 	hsm_f_ctxt_t	*hsm_f_ctxtp,
 const	char		*namep,		/* attribute name */
-	u_int32_t	valuesz,	/* value size */
+	uint32_t	valuesz,	/* value size */
 	int		flag,
 	int		*skip_entry)
 {
@@ -698,7 +698,7 @@ HsmAddNewAttribute(
 	int		flag,
 	char		**namepp,	/* pointer to new attribute name */
 	char		**valuepp,	/* pointer to its value */
-	u_int32_t	*valueszp)	/* pointer to the value size */
+	uint32_t	*valueszp)	/* pointer to the value size */
 {
 	dmf_f_ctxt_t	*dmf_f_ctxtp = (dmf_f_ctxt_t *)hsm_f_ctxtp;
 	XFSattrvalue1_t	*dmfattr1p = (XFSattrvalue1_t *)dmf_f_ctxtp->attrval;
diff --git a/common/hsmapi.h b/common/hsmapi.h
index 665499c..b6d035d 100644
--- a/common/hsmapi.h
+++ b/common/hsmapi.h
@@ -252,7 +252,7 @@ extern int
 HsmFilterExistingAttribute(
 	hsm_f_ctxt_t	*hsm_f_ctxtp,
 const	char		*namep,		/* name of attribute to filter */
-	u_int32_t	valuesz,	/* attribute's current value size */
+	uint32_t	valuesz,	/* attribute's current value size */
 	int		flag,		/* ext attr flags */
 	int		*skip_entry);
 
@@ -290,7 +290,7 @@ HsmAddNewAttribute(
 	int		flag,		/* ext attr flags */
 	char		**namepp,	/* pointer to new attribute name */
 	char		**valuepp,	/* pointer to its value */
-	u_int32_t	*valueszp);	/* pointer to the value size */
+	uint32_t	*valueszp);	/* pointer to the value size */
 
 
 /******************************************************************************
diff --git a/common/inventory.c b/common/inventory.c
index d1c067b..83e1ebb 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -80,7 +80,7 @@ inv_open( inv_predicate_t bywhat, void *pred )
 	}
 	/* create another storage object ( and, an inv_index entry for it too )
 	   if we've filled this one up */
-	if ( (u_int) num >= sescnt->ic_maxnum ) {
+	if ( (uint) num >= sescnt->ic_maxnum ) {
 #ifdef INVT_DEBUG
 		printf("$ creating a new storage obj & index entry. \n" );
 #endif
@@ -225,7 +225,7 @@ inv_writesession_open(
 	uuid_t		*sesid,
 	char		*label,
 	u_char		level,
-	u_int		nstreams,
+	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
 	char		*devpath )
diff --git a/common/inventory.h b/common/inventory.h
index 351f6e0..f9fcb19 100644
--- a/common/inventory.h
+++ b/common/inventory.h
@@ -98,7 +98,7 @@ typedef struct inv_stream {
 typedef struct inv_session {
 	uuid_t		 s_fsid;	/* file system */
 	uuid_t 		 s_sesid;	/* this dump session's id: 16 bytes*/
-	u_int		 s_nstreams;	/* number of media streams recorded */
+	uint		 s_nstreams;	/* number of media streams recorded */
 	inv_stream_t	*s_streams;	/* array of streams */
 	time32_t	 s_time;   	/* time of the dump */
 	u_char		 s_level;  	/* dump level */
@@ -159,7 +159,7 @@ inv_writesession_open(
 	uuid_t		*sesid,
 	char		*label,
 	u_char		level,
-	u_int		nstreams,
+	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
 	char		*devpath );
diff --git a/common/main.c b/common/main.c
index 08bf574..e381e85 100644
--- a/common/main.c
+++ b/common/main.c
@@ -170,10 +170,10 @@ main( int argc, char *argv[] )
 	assert( sizeof( char_t ) == 1 );
 	assert( sizeof( u_char_t ) == 1 );
 	assert( sizeof( int32_t ) == 4 );
-	assert( sizeof( u_int32_t ) == 4 );
+	assert( sizeof( uint32_t ) == 4 );
 	assert( sizeof( size32_t ) == 4 );
 	assert( sizeof( int64_t ) == 8 );
-	assert( sizeof( u_int64_t ) == 8 );
+	assert( sizeof( uint64_t ) == 8 );
 	assert( sizeof( size64_t ) == 8 );
 
 	/* record the command name used to invoke
@@ -662,7 +662,7 @@ main( int argc, char *argv[] )
 	 * signals.
 	 */
 	if ( progrpt_enabledpr ) {
-		( void )alarm( ( u_int )progrpt_interval );
+		( void )alarm( ( uint )progrpt_interval );
 	}
 	for ( ; ; ) {
 		time32_t now;
@@ -813,7 +813,7 @@ main( int argc, char *argv[] )
 			      "setting alarm for %d second%s\n",
 			      timeout,
 			      timeout == 1 ? "" : "s" );
-			( void )alarm( ( u_int )timeout );
+			( void )alarm( ( uint )timeout );
 			if ( timeout == 0 ) {
 				continue;
 			}
@@ -835,7 +835,7 @@ main( int argc, char *argv[] )
 					      statline[ i ] );
 				}
 			}
-			( void )alarm( ( u_int )( progrpt_deadline
+			( void )alarm( ( uint )( progrpt_deadline
 						       -
 						       now ));
 		}
diff --git a/common/media.h b/common/media.h
index ee1975f..0b727e5 100644
--- a/common/media.h
+++ b/common/media.h
@@ -46,15 +46,15 @@ struct media_hdr {
 		/* ID of upstream media object */
 	char mh_pad2[ GLOBAL_HDR_UUID_SZ ];		/*  10  330 */
 		/* in case more IDs needed */
-	u_int32_t mh_mediaix;				/*   4  334 */
+	uint32_t mh_mediaix;				/*   4  334 */
 		/* 0-based index of this media object within the dump stream */
-	u_int32_t mh_mediafileix;			/*   4  338 */
+	uint32_t mh_mediafileix;			/*   4  338 */
 		/* 0-based index of this file within this media object */
-	u_int32_t mh_dumpfileix;			/*   4  33c */
+	uint32_t mh_dumpfileix;			/*   4  33c */
 		/* 0-based index of this file within this dump stream */
-	u_int32_t mh_dumpmediafileix;			/*   4  340 */
+	uint32_t mh_dumpmediafileix;			/*   4  340 */
 		/* 0-based index of file within dump stream and media object */
-	u_int32_t mh_dumpmediaix;			/*   4  344 */
+	uint32_t mh_dumpmediaix;			/*   4  344 */
 		/* 0-based index of this dump within the media object */
 	int32_t mh_strategyid;				/*   4  348 */
 		/* ID of the media strategy used to produce this dump */
diff --git a/common/rec_hdr.h b/common/rec_hdr.h
index b8f4571..552447c 100644
--- a/common/rec_hdr.h
+++ b/common/rec_hdr.h
@@ -36,7 +36,7 @@
  * structure, and add a endian conversion function to arch_xlate.c 
  */
 struct rec_hdr {
-	u_int64_t magic;			/*   8   8 */
+	uint64_t magic;			/*   8   8 */
 		/* magic number STAPE_MAGIC (see above)
 		 */
 	int32_t version;			/*   4   c */
@@ -62,7 +62,7 @@ struct rec_hdr {
 		/* raw media file byte offset of first mark set
 		 * in this record. set to -1 if no marks in record
 		 */
-	u_int32_t rec_used;			/*   4  34 */
+	uint32_t rec_used;			/*   4  34 */
 		/* portion of record containing user data plus rec hdr (bytes).
 		 * normally set to record size. last record written may
 		 * indicate smaller value. includes record header.
diff --git a/common/types.h b/common/types.h
index 9afb3a7..235f52a 100644
--- a/common/types.h
+++ b/common/types.h
@@ -18,6 +18,11 @@
 #ifndef TYPES_H
 #define TYPES_H
 
+/*
+ * Pull in all the standard C types first.
+ */
+#include <stdint.h>
+
 #define XFSDUMP_DIRPATH	inv_basepath()
 
 /*
@@ -34,11 +39,11 @@
 
 /* integers
  */
-typedef u_int32_t size32_t;
-typedef u_int64_t size64_t;
+typedef uint32_t size32_t;
+typedef uint64_t size64_t;
 typedef char char_t;
 typedef unsigned char u_char_t;
-typedef unsigned int u_int;
+typedef unsigned int uint;
 typedef long long_t;
 typedef unsigned long u_long_t;
 typedef size_t ix_t;
@@ -63,15 +68,15 @@ typedef int32_t time32_t;
 #define MKSMAX( t )	MKMAX( t, 1ull )
 #define MKUMAX( t )	MKMAX( t, 0ull )
 #define INT32MAX	MKSMAX( int32_t )
-#define UINT32MAX	MKUMAX( u_int32_t )
+#define UINT32MAX	MKUMAX( uint32_t )
 #define SIZE32MAX	MKUMAX( size32_t )
 #define INT64MAX	MKSMAX( int64_t )
-#define UINT64MAX	MKUMAX( u_int64_t )
+#define UINT64MAX	MKUMAX( uint64_t )
 #define SIZE64MAX	MKUMAX( size64_t )
 #define INO64MAX	MKUMAX( xfs_ino_t )
 #define OFF64MAX	MKSMAX( off64_t )
 #define INTGENMAX	MKSMAX( int )
-#define UINTGENMAX	MKUMAX( u_int )
+#define UINTGENMAX	MKUMAX( uint )
 #define OFFMAX		MKSMAX( off_t )
 #define SIZEMAX		MKUMAX( size_t )
 #define IXMAX		MKUMAX( size_t )
diff --git a/dump/content.c b/dump/content.c
index 00a7bad..fcd7dd7 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -363,7 +363,7 @@ static char *dump_extattr_buildrecord( xfs_bstat_t *statp,
 				       char *dumpbufp,
 				       char *dumpbufendp,
 				       char *namesrcp,
-				       u_int32_t valuesz,
+				       uint32_t valuesz,
 				       int flag,
 				       char **valuepp );
 static rv_t dump_extattrhdr( drive_t *drivep,
@@ -372,7 +372,7 @@ static rv_t dump_extattrhdr( drive_t *drivep,
 			     size_t recsz,
 			     size_t valoff,
 			     ix_t flags,
-			     u_int32_t valsz );
+			     uint32_t valsz );
 
 static bool_t save_quotas( char *mntpnt,
 			   quota_info_t *quotainfo );
@@ -385,8 +385,8 @@ static int getxfsqstat( char *fsdev );
 bool_t content_media_change_needed;
 char *media_change_alert_program = NULL;
 hsm_fs_ctxt_t *hsm_fs_ctxtp = NULL;
-u_int64_t hdr_mfilesz = 0;
-u_int64_t maxdumpfilesize = 0;
+uint64_t hdr_mfilesz = 0;
+uint64_t maxdumpfilesize = 0;
 bool_t allowexcludefiles_pr = BOOL_FALSE;
 
 /* definition of locally defined static variables *****************************/
@@ -554,14 +554,14 @@ content_init( int argc,
 	char *baseuuidstr = NULL;
 	uuid_t baseuuid;
 	bool_t baseuuidvalpr;
-	u_int64_t dircnt;
-	u_int64_t nondircnt;
-	u_int64_t datasz;
-	u_int64_t inocnt;
-	u_int64_t inomapsz;
-	u_int64_t direntsz;
-	u_int64_t filesz;
-	u_int64_t size_estimate;
+	uint64_t dircnt;
+	uint64_t nondircnt;
+	uint64_t datasz;
+	uint64_t inocnt;
+	uint64_t inomapsz;
+	uint64_t direntsz;
+	uint64_t filesz;
+	uint64_t size_estimate;
 
 	/* basic sanity checks
 	 */
@@ -1517,8 +1517,8 @@ baseuuidbypass:
 	datasz = scwhdrtemplatep->cih_inomap_datasz;
 	inocnt = dircnt + nondircnt;
 	inomapsz = inomap_getsz( );
-	direntsz = inocnt * ( u_int64_t )( DIRENTHDR_SZ + 8 );
-	filesz = inocnt * ( u_int64_t )( FILEHDR_SZ + EXTENTHDR_SZ );
+	direntsz = inocnt * ( uint64_t )( DIRENTHDR_SZ + 8 );
+	filesz = inocnt * ( uint64_t )( FILEHDR_SZ + EXTENTHDR_SZ );
 
 	hdr_mfilesz =	GLOBAL_HDR_SZ
 			+
@@ -2563,7 +2563,7 @@ decision_more:
 			ok = inv_put_mediafile( inv_stmt,
 						&mwhdrp->mh_mediaid,
 						mwhdrp->mh_medialabel,
-					( u_int )mwhdrp->mh_mediafileix,
+					( uint )mwhdrp->mh_mediafileix,
 						startino,
 						startoffset,
 						scwhdrp->cih_startpt.sp_ino,
@@ -3445,7 +3445,7 @@ dump_extattr_list( drive_t *drivep,
 			char	*hsmnamep;
 			char	*hsmvaluep;
 			char	*valuep;
-			u_int32_t	hsmvaluesz;
+			uint32_t	hsmvaluesz;
 
 			if (!HsmAddNewAttribute(contextp->cc_hsm_f_ctxtp,
 						hsmcursor,
@@ -3558,16 +3558,16 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
 			  char *dumpbufp,
 			  char *dumpbufendp,
 			  char *namesrcp,
-			  u_int32_t valuesz,
+			  uint32_t valuesz,
 			  int flag,
 			  char **valuepp )
 {
 	extattrhdr_t *ahdrp = ( extattrhdr_t * )dumpbufp;
 	char *namep = dumpbufp + EXTATTRHDR_SZ;
-	u_int32_t namelen = strlen( namesrcp );
-	u_int32_t namesz = namelen + 1;
+	uint32_t namelen = strlen( namesrcp );
+	uint32_t namesz = namelen + 1;
 	char *valuep = namep + namesz;
-	u_int32_t recsz = EXTATTRHDR_SZ + namesz + valuesz;
+	uint32_t recsz = EXTATTRHDR_SZ + namesz + valuesz;
 	extattrhdr_t tmpah;
 
 	recsz = ( recsz + ( EXTATTRHDR_ALIGN - 1 ))
@@ -3620,8 +3620,8 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
 	memset( ( void * )&tmpah, 0, sizeof( tmpah ));
 	tmpah.ah_sz = recsz;
 	assert( EXTATTRHDR_SZ + namesz < UINT16MAX );
-	tmpah.ah_valoff = ( u_int16_t )( EXTATTRHDR_SZ + namesz );
-	tmpah.ah_flags = ( u_int16_t )
+	tmpah.ah_valoff = ( uint16_t )( EXTATTRHDR_SZ + namesz );
+	tmpah.ah_flags = ( uint16_t )
 		(( flag & ATTR_ROOT ) ? EXTATTRHDR_FLAGS_ROOT :
 		(( flag & ATTR_SECURE ) ? EXTATTRHDR_FLAGS_SECURE : 0));
 	tmpah.ah_valsz = valuesz;
@@ -3641,7 +3641,7 @@ dump_extattrhdr( drive_t *drivep,
 		 size_t recsz,
 		 size_t valoff,
 		 ix_t flags,
-		 u_int32_t valsz )
+		 uint32_t valsz )
 {
 	extattrhdr_t ahdr;
 	extattrhdr_t tmpahdr;
@@ -3651,8 +3651,8 @@ dump_extattrhdr( drive_t *drivep,
 	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
 	ahdr.ah_sz = recsz;
 	assert( valoff < UINT16MAX );
-	ahdr.ah_valoff = ( u_int16_t )valoff;
-	ahdr.ah_flags = ( u_int16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
+	ahdr.ah_valoff = ( uint16_t )valoff;
+	ahdr.ah_flags = ( uint16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
 	ahdr.ah_valsz = valsz;
 	ahdr.ah_checksum = calc_checksum( &ahdr, EXTATTRHDR_SZ );
 
@@ -5120,8 +5120,8 @@ dump_dirent( drive_t *drivep,
 
 		memset( ( void * )dhdrp, 0, sz );
 		dhdrp->dh_ino = ino;
-		dhdrp->dh_sz = ( u_int16_t )sz;
-		dhdrp->dh_gen = ( u_int16_t )( gen & DENTGENMASK );
+		dhdrp->dh_sz = ( uint16_t )sz;
+		dhdrp->dh_gen = ( uint16_t )( gen & DENTGENMASK );
 		if ( name ) {
 			strcpy( dhdrp->dh_name, name );
 		}
@@ -5139,7 +5139,7 @@ dump_dirent( drive_t *drivep,
 		memset( ( void * )dhdrp, 0, sz );
 		dhdrp->dh_ino = ino;
 		dhdrp->dh_gen = gen;
-		dhdrp->dh_sz = ( u_int16_t )sz;
+		dhdrp->dh_sz = ( uint16_t )sz;
 		if ( name ) {
 			strcpy( dhdrp->dh_name, name );
 		}
@@ -5327,7 +5327,7 @@ dump_session_inv( drive_t *drivep,
 			ok = inv_put_mediafile( inv_stmt,
 						&mediaid,
 						medialabel,
-						( u_int )mediafileix,
+						( uint )mediafileix,
 						(xfs_ino_t )0,
 						( off64_t )0,
 						(xfs_ino_t )0,
@@ -5572,8 +5572,8 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
 		switch ( entrystate ) {
 		case BES_INIT:
 			mediawrittentopr = BOOL_FALSE;
-			mwhdrp->mh_mediaix = ( u_int32_t )( -1 );
-			mwhdrp->mh_dumpfileix = ( u_int32_t )( -1 );
+			mwhdrp->mh_mediaix = ( uint32_t )( -1 );
+			mwhdrp->mh_dumpfileix = ( uint32_t )( -1 );
 			if ( dcaps & DRIVE_CAP_READ ) {
 				mediapresentpr = BOOL_UNKNOWN;
 				virginmediapr = BOOL_UNKNOWN;
@@ -6030,8 +6030,8 @@ write:
 		mwhdrp->mh_mediaix++; /* pre-initialized to -1 */
 	}
 
-	assert( mwhdrp->mh_mediaix != ( u_int32_t )( -1 ));
-	assert( mwhdrp->mh_dumpfileix != ( u_int32_t )( -1 ));
+	assert( mwhdrp->mh_mediaix != ( uint32_t )( -1 ));
+	assert( mwhdrp->mh_dumpfileix != ( uint32_t )( -1 ));
 
 	/* do not allow interleaving of media files from different xfsdumps.
 	 */
diff --git a/dump/inomap.c b/dump/inomap.c
index 06f3869..4e57a78 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -62,7 +62,7 @@
 extern bool_t preemptchk( int );
 extern size_t pgsz;
 extern hsm_fs_ctxt_t *hsm_fs_ctxtp;
-extern u_int64_t maxdumpfilesize;
+extern uint64_t maxdumpfilesize;
 extern bool_t allowexcludefiles_pr;
 
 /* forward declarations of locally defined static functions ******************/
@@ -133,8 +133,8 @@ static int subtreelist_parse( jdm_fshandle_t *,
 static ix_t *inomap_statphasep;
 static ix_t *inomap_statpassp;
 static size64_t *inomap_statdonep;
-static u_int64_t inomap_exclude_filesize = 0;
-static u_int64_t inomap_exclude_skipattr = 0;
+static uint64_t inomap_exclude_filesize = 0;
+static uint64_t inomap_exclude_skipattr = 0;
 
 /* definition of locally defined global functions ****************************/
 
@@ -949,7 +949,7 @@ cb_startpt( void *arg1,
 /* define structure for ino to gen mapping.
  */
 struct i2gseg {
-	u_int64_t s_valid;
+	uint64_t s_valid;
 	gen_t s_gen[ INOPERSEG ];
 };
 typedef struct i2gseg i2gseg_t;
@@ -971,10 +971,10 @@ static inline void
 SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
 {
 	register xfs_ino_t relino;
-	register u_int64_t mask;
-	register u_int64_t clrmask;
+	register uint64_t mask;
+	register uint64_t clrmask;
 	relino = ino - segp->base;
-	mask = ( u_int64_t )1 << relino;
+	mask = ( uint64_t )1 << relino;
 	clrmask = ~mask;
 	switch( state ) {
 	case 0:
@@ -1025,9 +1025,9 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 {
 	int state;
 	register xfs_ino_t relino;
-	register u_int64_t mask;
+	register uint64_t mask;
 	relino = ino - segp->base;
-	mask = ( u_int64_t )1 << relino;
+	mask = ( uint64_t )1 << relino;
 	if ( segp->lobits & mask ) {
 		state = 1;
 	} else {
@@ -1063,7 +1063,7 @@ inomap_init( int igrpcnt )
 	return 0;
 }
 
-u_int64_t
+uint64_t
 inomap_getsz( void )
 {
 	return (inomap.lastseg.hnkoff + 1) * HNKSZ;
@@ -1378,7 +1378,7 @@ inomap_set_gen(void *contextp, xfs_ino_t ino, gen_t gen)
 	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
 
 	relino = ino - segp->base;
-	i2gsegp->s_valid |= (u_int64_t)1 << relino;
+	i2gsegp->s_valid |= (uint64_t)1 << relino;
 	i2gsegp->s_gen[relino] = gen;
 }
 
@@ -1399,7 +1399,7 @@ inomap_get_gen( void *contextp, xfs_ino_t ino, gen_t *gen )
 	i2gsegp = &inomap.i2gmap[inomap_addr2segix( addrp )];
 
 	relino = ino - segp->base;
-	if ( ! (i2gsegp->s_valid & ((u_int64_t)1 << relino)) )
+	if ( ! (i2gsegp->s_valid & ((uint64_t)1 << relino)) )
 		return 1;
 
 	*gen = i2gsegp->s_gen[relino];
@@ -1413,11 +1413,11 @@ inomap_writehdr( content_inode_hdr_t *scwhdrp )
 	 */
 	scwhdrp->cih_inomap_hnkcnt = inomap.lastseg.hnkoff + 1;
 	scwhdrp->cih_inomap_segcnt = inomap_addr2segix( &inomap.lastseg ) + 1;
-	scwhdrp->cih_inomap_dircnt = ( u_int64_t )cb_dircnt;
-	scwhdrp->cih_inomap_nondircnt = ( u_int64_t )cb_nondircnt;
+	scwhdrp->cih_inomap_dircnt = ( uint64_t )cb_dircnt;
+	scwhdrp->cih_inomap_nondircnt = ( uint64_t )cb_nondircnt;
 	scwhdrp->cih_inomap_firstino = inomap.hnkmap[0].seg[ 0 ].base;
 	scwhdrp->cih_inomap_lastino = inomap.hnkmap[inomap.lastseg.hnkoff].maxino;
-	scwhdrp->cih_inomap_datasz = ( u_int64_t )cb_datasz;
+	scwhdrp->cih_inomap_datasz = ( uint64_t )cb_datasz;
 }
 
 rv_t
diff --git a/dump/inomap.h b/dump/inomap.h
index 663b434..f222642 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -65,7 +65,7 @@ extern bool_t inomap_build( jdm_fshandle_t *fshandlep,
 			    size64_t statcnt,
 			    size64_t *statdonep );
 
-extern u_int64_t inomap_getsz( void );
+extern uint64_t inomap_getsz( void );
 
 /* inomap_skip - tell inomap about inodes to skip in the dump
  */
@@ -103,9 +103,9 @@ extern rv_t inomap_dump( drive_t *drivep );
  */
 struct seg {
 	xfs_ino_t base;
-	u_int64_t lobits;
-	u_int64_t mebits;
-	u_int64_t hibits;
+	uint64_t lobits;
+	uint64_t mebits;
+	uint64_t hibits;
 };
 
 typedef struct seg seg_t;
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 4c1855b..888c425 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -94,7 +94,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
 	/* create another storage object ( and, an inv_index entry for it 
 	   too ) if we've filled this one up */
 
-	if ( (u_int) num >= sescnt->ic_maxnum ) {
+	if ( (uint) num >= sescnt->ic_maxnum ) {
 		mlog( MLOG_DEBUG | MLOG_INV, "$ INV: creating a new storage obj & "
 		      "index entry. \n" );
 		INVLOCK( stobjfd, LOCK_UN );
@@ -163,7 +163,7 @@ inv_writesession_open(
 	bool_t		ispartial,
 	bool_t		isresumed,
 	u_char		level,
-	u_int		nstreams,
+	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
 	char		*devpath )
@@ -439,7 +439,7 @@ inv_put_mediafile(
 	inv_stmtoken_t 	tok, 
 	uuid_t 		*moid, 
 	char 		*label,
-	u_int		mfileindex,
+	uint		mfileindex,
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
 	xfs_ino_t	endino,
diff --git a/inventory/inv_core.c b/inventory/inv_core.c
index 419f575..a17c2c9 100644
--- a/inventory/inv_core.c
+++ b/inventory/inv_core.c
@@ -49,7 +49,7 @@ int
 get_counters( int fd, void **cntpp, size_t cntsz )
 {
 	/* object must be locked at least SHARED by caller */
-	u_int num;
+	uint num;
 	assert( cntsz >= sizeof( invt_counter_t ) );
 
 	*cntpp =  calloc( 1, cntsz);
@@ -238,7 +238,7 @@ get_lastheader( int fd, void **ent, size_t hdrsz, size_t cntsz )
 	/* if there's space anywhere at all, then it must be in the last
 	   entry */
 	*ent = malloc( hdrsz );
-	pos = (char *) arr + ( (u_int)nindices - 1 ) * hdrsz;
+	pos = (char *) arr + ( (uint)nindices - 1 ) * hdrsz;
 	memcpy( *ent, pos, hdrsz );
 	free ( arr );
 	free ( cnt );
diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
index 13b64db..95529e8 100644
--- a/inventory/inv_idx.c
+++ b/inventory/inv_idx.c
@@ -43,13 +43,13 @@
 /* given a time, find the invindex that has the time-period it can fit  */
 /* into.                                                                */
 /*----------------------------------------------------------------------*/
-u_int
+uint
 idx_insert_newentry( int fd, /* kept locked EX by caller */
 		     int *stobjfd, /* OUT */
 		     invt_entry_t *iarr, invt_counter_t *icnt,
 		     time32_t tm )
 {
-	u_int i;
+	uint i;
 	inv_oflag_t forwhat = INV_SEARCH_N_MOD;
 /*	invt_entry_t ient;
 	ient.ie_timeperiod.tp_start = ient.ie_timeperiod.tp_end = tm; */
@@ -162,7 +162,7 @@ idx_put_newentry(
 	int stobjfd;
 	
 	int fd = idx->invfd; 	/* kept locked EX by caller */
-	u_int index = idx->index + 1;
+	uint index = idx->index + 1;
 	invt_entry_t *iarr = idx->iarr;
 	invt_counter_t *icnt = idx->icnt;
 
@@ -356,7 +356,7 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
 				sizeof( invt_counter_t ))) < 0 ) {
 			return -1;		 
 		}
-		idx_DEBUG_printinvindices( iarr, (u_int) nindices );
+		idx_DEBUG_printinvindices( iarr, (uint) nindices );
 		free( iarr );
 		free( icnt );
 	}
@@ -496,10 +496,10 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
 
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, u_int num )
+idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num )
 {
-	u_int i;
-	u_int k;
+	uint i;
+	uint k;
 
 	char s[9];
 	printf( "\n ==================================\n"
@@ -533,7 +533,7 @@ idx_DEBUG_print ( int fd )
 				         sizeof( invt_counter_t ))) < 0 ) {
 		return -1;		 
 	}
-	idx_DEBUG_printinvindices( iarr, (u_int) nindices );
+	idx_DEBUG_printinvindices( iarr, (uint) nindices );
 	free( iarr );
 	free( icnt );
 
@@ -543,7 +543,7 @@ idx_DEBUG_print ( int fd )
 
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, u_int ref,
+DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
 			  invt_pr_ctx_t *prctx)
 {
 	inv_session_t *ses;
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index 1b99d5c..e521f24 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -346,7 +346,7 @@ invmgr_inv_print(
 	invt_entry_t	*iarr = NULL;
 	invt_counter_t	*icnt = NULL;
 	int	     	nindices;
-	u_int           ref = 0;
+	uint           ref = 0;
 
 	if (invfd == I_EMPTYINV)
 		return 0;
@@ -363,7 +363,7 @@ invmgr_inv_print(
 	free( icnt );
 
 	if (prctx->invidx) {
-		idx_DEBUG_printinvindices( iarr, (u_int) nindices );
+		idx_DEBUG_printinvindices( iarr, (uint) nindices );
 		free(iarr);
 		return (0);
 	}
diff --git a/inventory/inv_priv.h b/inventory/inv_priv.h
index 598c366..1690271 100644
--- a/inventory/inv_priv.h
+++ b/inventory/inv_priv.h
@@ -48,8 +48,8 @@
 #define NEW_INVINDEX		2
 
 /* session flags ( seshdr.sh_flag ) */
-#define INVT_PARTIAL		(u_int)0x0001
-#define INVT_RESUMED            (u_int)0x0002
+#define INVT_PARTIAL		(uint)0x0001
+#define INVT_RESUMED            (uint)0x0002
 
 /* media file flags ( mfile.mf_flag ) */
 #define INVT_MFILE_GOOD         (u_char)0x01
@@ -108,9 +108,9 @@ typedef struct invt_session {
 	char		 s_label[INV_STRLEN];  /* session label */
 	char		 s_mountpt[INV_STRLEN];/* path to the mount point */
 	char		 s_devpath[INV_STRLEN];/* path to the device */
-	u_int		 s_cur_nstreams;/* number of streams created under
+	uint		 s_cur_nstreams;/* number of streams created under
 					   this session so far */
-	u_int		 s_max_nstreams;/* number of media streams in 
+	uint		 s_max_nstreams;/* number of media streams in 
 					   the session */
 	char		 s_padding[16];
 } invt_session_t;			   
@@ -148,7 +148,7 @@ typedef struct invt_stream {
 	off64_t		st_firstmfile;	/*offsets to the start and end of*/
 	off64_t		st_lastmfile;	/* .. linked list of mediafiles */
 	char            st_cmdarg[INV_STRLEN]; /* drive path */
-	u_int		st_nmediafiles; /* number of mediafiles */
+	uint		st_nmediafiles; /* number of mediafiles */
 	bool_t		st_interrupted;	/* was this stream interrupted ? */
 	char		st_padding[16];
 } invt_stream_t;
@@ -163,7 +163,7 @@ typedef struct invt_mediafile {
 					   media file with */
 	off64_t		 mf_nextmf;	/* links to other mfiles */
 	off64_t		 mf_prevmf;
-	u_int		 mf_mfileidx; 	/* index within the media object */
+	uint		 mf_mfileidx; 	/* index within the media object */
 	u_char           mf_flag;       /* Currently MFILE_GOOD, INVDUMP */
 	off64_t		 mf_size;       /* size of the media file */
 	char		 mf_padding[15];
@@ -185,9 +185,9 @@ typedef struct invt_entry {
 /* Cheap Inheritance, and an attempt to avoid a nested type */
 #define INVT_COUNTER_FIELDS  \
         __uint32_t    ic_vernum;/* on disk version number for posterity */\
-	u_int	      ic_curnum;/* number of sessions/invindices recorded \
+	uint	      ic_curnum;/* number of sessions/invindices recorded \
 				   so far */				  \
-	u_int	      ic_maxnum;/* maximum number of sessions/inv_indices \
+	uint	      ic_maxnum;/* maximum number of sessions/inv_indices \
 				   that we can record on this stobj */
 #define INVT_COUNTER_FIELDS_SIZE 0xc
 
@@ -272,7 +272,7 @@ typedef struct invt_idxinfo {
 	int 		invfd;
 	invt_counter_t	*icnt;
 	invt_entry_t	*iarr;
-	u_int		index;
+	uint		index;
 }invt_idxinfo_t;
 
 #define INVT_MOID	1
@@ -366,7 +366,7 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime);
 int
 idx_find_stobj( invt_idxinfo_t *idx, time32_t tm );
 
-u_int
+uint
 idx_insert_newentry( int fd, int *stobjfd, invt_entry_t *iarr, 
 		     invt_counter_t *icnt,
 		     time32_t tm );
@@ -380,7 +380,7 @@ int
 idx_recons_time( time32_t tm, invt_idxinfo_t *idx );
 
 int
-idx_DEBUG_printinvindices( invt_entry_t *iarr, u_int num );
+idx_DEBUG_printinvindices( invt_entry_t *iarr, uint num );
 
 int
 idx_DEBUG_print ( int fd );
@@ -415,10 +415,10 @@ int
 stobj_hdrcmp( const void *h1, const void *h2 );
 
 int
-stobj_sortheaders( int fd, u_int num );
+stobj_sortheaders( int fd, uint num );
 
-u_int
-stobj_find_splitpoint( int fd, invt_seshdr_t *harr, u_int ns, time32_t tm );
+uint
+stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm );
 
 int
 stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt, 
@@ -467,7 +467,7 @@ stobj_copy_invsess( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		    inv_session_t **buf);
 
 void
-DEBUG_sessionprint( inv_session_t *ses, u_int ref, invt_pr_ctx_t *prctx);
+DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx);
 
 void
 DEBUG_sessprint( invt_session_t *ses );
@@ -572,7 +572,7 @@ bool_t
 lastsess_level_equalto( int fd, invt_seshdr_t *hdr,  void *arg, void **buf );
 
 int
-DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, u_int ref, 
+DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref, 
 			  invt_pr_ctx_t *prctx);
 
 int
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 0b6aa45..0763d0b 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -62,7 +62,7 @@ stobj_insert_session( invt_idxinfo_t *idx,
 	/* Check the existing sessions to make sure that we're not
 	   duplicating this session */
 	if ( sescnt->ic_curnum > 0 ) {
-		u_int i;
+		uint i;
 		invt_session_t	*sessions = calloc( sescnt->ic_curnum, 
 				   sizeof( invt_session_t ) );
 		if ( GET_REC_NOLOCK( fd, sessions, sescnt->ic_curnum *
@@ -123,10 +123,10 @@ stobj_insert_session( invt_idxinfo_t *idx,
 
 
 /* ARGSUSED */
-u_int
-stobj_find_splitpoint( int fd, invt_seshdr_t *harr, u_int ns, time32_t tm )
+uint
+stobj_find_splitpoint( int fd, invt_seshdr_t *harr, uint ns, time32_t tm )
 {
-	u_int i;
+	uint i;
 
 	if ( harr[ns-1].sh_time < tm )
 		return ns;
@@ -165,7 +165,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
 	     invt_sessinfo_t *newsess )
 {
 	invt_seshdr_t 	*harr = NULL;
-	u_int          	i, ix, ns = sescnt->ic_curnum;
+	uint          	i, ix, ns = sescnt->ic_curnum;
 	void        	*bufpp;
 	size_t        	bufszp;
 	invt_sessinfo_t sesinfo;
@@ -341,7 +341,7 @@ stobj_put_session(
 		sescnt->ic_eof += (off64_t)( ses->s_max_nstreams * 
 					     sizeof( invt_stream_t ) );
 	} else {
-		u_int i;
+		uint i;
 		size_t nmf = 0;
 		sescnt->ic_eof += (off64_t)( ses->s_cur_nstreams * 
 					     sizeof( invt_stream_t ) );
@@ -386,7 +386,7 @@ stobj_put_session(
 /*----------------------------------------------------------------------*/
 
 int
-stobj_sortheaders( int fd, u_int num )
+stobj_sortheaders( int fd, uint num )
 {
 	size_t sz = sizeof( invt_seshdr_t ) * num;
 	invt_seshdr_t *hdrs;
@@ -440,11 +440,11 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles )
 {
-	u_int	nstm = ses->s_cur_nstreams;
+	uint	nstm = ses->s_cur_nstreams;
 	off64_t off  = hdr->sh_streams_off;
 	off64_t mfileoff = off + (off64_t)( nstm * sizeof( invt_stream_t ) );
-	u_int nmfiles = 0;
-	u_int i,j;
+	uint nmfiles = 0;
+	uint i,j;
 
 	/* fix the offsets in streams */
 	for ( i = 0; i < nstm; i++ ) {
@@ -737,7 +737,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
 		     void  **bufpp, size_t *bufszp )
 {
 	size_t	      	stmsz;
-	u_int		i, j;
+	uint		i, j;
 	size_t		sessz;
 	invt_stream_t  *strms;
 	char	       *sesbuf, *sesbufcp;
@@ -917,8 +917,8 @@ stobj_delete_mobj(int fd,
 	invt_stream_t  *strms;
 	off64_t		off;
 	invt_mediafile_t *mf, *mfiles;
-	u_int 		nmfiles;
-	u_int		i, j;
+	uint 		nmfiles;
+	uint		i, j;
 	bool_t 		dirty;
 
 	if ( GET_REC_NOLOCK( fd, &ses, sizeof( invt_session_t ),
@@ -1007,7 +1007,7 @@ stobj_unpack_sessinfo(
         size_t             bufsz,
 	invt_sessinfo_t   *s )
 {
-	u_int 		 i;
+	uint 		 i;
 	char	         *tmpbuf;
 	char 		 *p = (char *)bufp;
 	
@@ -1090,7 +1090,7 @@ stobj_unpack_sessinfo(
 #ifdef INVT_DELETION
 	{
 		int tmpfd = open( "moids", O_RDWR | O_CREAT, S_IRUSR|S_IWUSR );
-		u_int j;
+		uint j;
 		invt_mediafile_t *mmf = s->mfiles;
 		for (i=0; i< s->ses->s_cur_nstreams; i++ ) {
 			for (j=0; j< s->strms[ i ].st_nmediafiles; 
@@ -1235,7 +1235,7 @@ stobj_copy_invsess(int fd,
 	i = (int) ses->s_cur_nstreams;
 	while ( i-- ) {
 		off64_t		 off;
-		u_int            j, nmf;
+		uint            j, nmf;
 		
 		stobj_convert_strm(&ises->s_streams[i], &strms[i]);
 		nmf = strms[i].st_nmediafiles;
@@ -1305,7 +1305,7 @@ stobj_convert_sessinfo(inv_session_t **buf, invt_sessinfo_t *sinfo)
 	for ( i = 0 ; i < nstreams ; i++ ) {
 		stobj_convert_strm(&ises->s_streams[i], &sinfo->strms[i]);
 		nmf = (int) ises->s_streams[i].st_nmediafiles;
-		ises->s_streams[i].st_mediafiles = calloc( (u_int) nmf,
+		ises->s_streams[i].st_mediafiles = calloc( (uint) nmf,
 						    sizeof( inv_mediafile_t ) );
 
 		for ( j = 0; j < nmf; j++ ) {
@@ -1372,7 +1372,7 @@ bool_t
 check_for_mobj ( inv_session_t *ses, invt_mobjinfo_t *mobj )
 {
 	int i;
-	u_int j;
+	uint j;
 	inv_mediafile_t *mfp;
 
 	for (i = 0; i < (int) ses->s_nstreams; i++ ) {
@@ -1390,12 +1390,12 @@ check_for_mobj ( inv_session_t *ses, invt_mobjinfo_t *mobj )
 
 
 void
-DEBUG_sessionprint( inv_session_t *ses, u_int ref, invt_pr_ctx_t *prctx)
+DEBUG_sessionprint( inv_session_t *ses, uint ref, invt_pr_ctx_t *prctx)
 {
 	char str[UUID_STR_LEN + 1];
 	int i;
 	inv_mediafile_t *mfp;
-	static u_int fsidxprinted = -1;
+	static uint fsidxprinted = -1;
 
        invt_mobjinfo_t *mobj = &prctx->mobj;
 
@@ -1405,8 +1405,8 @@ DEBUG_sessionprint( inv_session_t *ses, u_int ref, invt_pr_ctx_t *prctx)
 			return;
 	}
 		
-	if ( ref == 0 || fsidxprinted != (u_int) prctx->index ) {
-		fsidxprinted = (u_int) prctx->index;
+	if ( ref == 0 || fsidxprinted != (uint) prctx->index ) {
+		fsidxprinted = (uint) prctx->index;
 
 		printf("file system %d:\n", prctx->index);
 		uuid_unparse( ses->s_fsid, str );
@@ -1435,7 +1435,7 @@ DEBUG_sessionprint( inv_session_t *ses, u_int ref, invt_pr_ctx_t *prctx)
 		return;
 
 	for (i = 0; i < (int) ses->s_nstreams; i++ ) {
-		u_int j;
+		uint j;
 		printf("\t\tstream %d:\n", i );
 		printf( "\t\t\tpathname:\t%s\n", ses->s_streams[i].st_cmdarg );
 		printf( "\t\t\tstart:\t\tino %llu offset %lld\n",
diff --git a/inventory/inventory.h b/inventory/inventory.h
index 43ac969..134b9ba 100644
--- a/inventory/inventory.h
+++ b/inventory/inventory.h
@@ -115,7 +115,7 @@ typedef enum {
 		     
 typedef struct inv_mediafile {
 	uuid_t		 m_moid;	/* media object id */
-	u_int		 m_mfile_index; /* index within the media object */
+	uint		 m_mfile_index; /* index within the media object */
 	xfs_ino_t	 m_startino;	/* file that we started out with */
 	off64_t		 m_startino_off;
 	xfs_ino_t	 m_endino;	/* the dump file we ended this .. */
@@ -139,7 +139,7 @@ typedef struct inv_stream {
 					   including this breakpoint. */
 	off64_t		st_endino_off;
 	char            st_cmdarg[INV_STRLEN]; /* the driver path user entered */
-	u_int		st_nmediafiles; /* number of mediafiles */
+	uint		st_nmediafiles; /* number of mediafiles */
 	inv_mediafile_t *st_mediafiles; /* array of all media files */
 } inv_stream_t;
 
@@ -161,9 +161,9 @@ typedef struct inv_session {
 	char		 s_label[INV_STRLEN];  /* session label */
 	char		 s_mountpt[INV_STRLEN];/* path to the mount point */
 	char		 s_devpath[INV_STRLEN];/* path to the device */
-	u_int		 s_nstreams;	/* num of media streams recorded */
+	uint		 s_nstreams;	/* num of media streams recorded */
 	inv_stream_t	*s_streams;	/* array of streams */
-        u_int            s_refnum;      /* storage location dependent ref.
+        uint            s_refnum;      /* storage location dependent ref.
 					   used in displaying the session and 
 					   nowhere else */
 					   
@@ -206,7 +206,7 @@ inv_writesession_open(
 	bool_t		ispartial,
         bool_t          isresumed,
 	u_char		level,
-	u_int		nstreams,
+	uint		nstreams,
 	time32_t	time,
 	char		*mntpt,
 	char		*devpath );	      
@@ -230,7 +230,7 @@ inv_put_mediafile(
 	inv_stmtoken_t 	tok, 
 	uuid_t 		*moid, 
 	char 		*label,
-	u_int		mfileindex,
+	uint		mfileindex,
 	xfs_ino_t	startino,
 	off64_t		startino_offset,
 	xfs_ino_t	endino,
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 7a268ea..3f742e4 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -145,7 +145,7 @@ delete_test( int n )
 int
 sess_queries_byuuid(char *uu)
 {
-	u_int stat;
+	uint stat;
 	uuid_t uuid;
 	inv_session_t *ses;
 	invt_pr_ctx_t prctx;
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 56995f0..44c5e7f 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -626,11 +626,11 @@ stobj_put_streams( int fd, invt_seshdr_t *hdr, invt_session_t *ses,
 		   invt_stream_t *strms,
 		   invt_mediafile_t *mfiles )
 {
-    u_int	nstm	= ses->s_cur_nstreams;
+    uint	nstm	= ses->s_cur_nstreams;
     off64_t	off	= hdr->sh_streams_off;
     off64_t	mfileoff= off + (off64_t)( nstm * sizeof( invt_stream_t ) );
-    u_int	nmfiles = 0;
-    u_int	i,j;
+    uint	nmfiles = 0;
+    uint	i,j;
 
     /* fix the offsets in streams */
      for ( i = 0; i < nstm; i++ ) {
diff --git a/restore/content.c b/restore/content.c
index ac7d72a..5e6e88e 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -526,10 +526,10 @@ struct pers {
 			/* the following stats are not valid until the
 			 * first media file header has been read.
 			 */
-		u_int64_t stat_inocnt;
+		uint64_t stat_inocnt;
 			/* number of non-dir inos to restore during session
 			 */
-		u_int64_t stat_inodone;
+		uint64_t stat_inodone;
 			/* number of non-dir inos restored so far
 			 */
 		off64_t stat_datacnt;
@@ -1615,11 +1615,11 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 			      strerror( errno ));
 			return BOOL_FALSE;
 		}
-		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( u_int64_t )0 );
+		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
 		if ( ! ok ) {
 			return BOOL_FALSE;
 		}
-		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( u_int64_t )0 );
+		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
 		if ( ! ok ) {
 			return BOOL_FALSE;
 		}
@@ -1841,7 +1841,7 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * determine if full init needed instead.
 	 */
 	if ( persp->a.valpr && persp->s.valpr ) {
-		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( u_int64_t )0 );
+		ok = dirattr_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
 		if ( ! ok ) {
 			return BOOL_FALSE;
 		}
@@ -1853,7 +1853,7 @@ content_init( int argc, char *argv[ ], size64_t vmsz )
 	 * determine if full init needed instead.
 	 */
 	if ( persp->a.valpr ) {
-		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( u_int64_t )0 );
+		ok = namreg_init( tranp->t_hkdir, BOOL_TRUE, ( uint64_t )0 );
 		if ( ! ok ) {
 			return BOOL_FALSE;
 		}
@@ -7532,7 +7532,7 @@ restore_reg( drive_t *drivep,
 		assert( bstatp->bs_extsize >= 0 );
 		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
 		fsxattr.fsx_xflags = bstatp->bs_xflags & ~POST_DATA_XFLAGS;
-		fsxattr.fsx_extsize = (u_int32_t) bstatp->bs_extsize;
+		fsxattr.fsx_extsize = (uint32_t) bstatp->bs_extsize;
 		fsxattr.fsx_projid = bstat_projid(bstatp);
 
 		rval = ioctl( *fdp, XFS_IOC_FSSETXATTR, (void *)&fsxattr);
@@ -7753,7 +7753,7 @@ restore_complete_reg(stream_context_t *strcxtp)
 		struct fsxattr fsxattr;
 		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
 		fsxattr.fsx_xflags = bstatp->bs_xflags;
-		fsxattr.fsx_extsize = (u_int32_t)bstatp->bs_extsize;
+		fsxattr.fsx_extsize = (uint32_t)bstatp->bs_extsize;
 		fsxattr.fsx_projid = bstat_projid(bstatp);
 
 		rval = ioctl( fd, XFS_IOC_FSSETXATTR, (void *)&fsxattr );
@@ -8364,8 +8364,8 @@ read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
 	mlog( MLOG_NITTY,
 	      "read extattr hdr sz %u valoff %u flags 0x%x valsz %u cs 0x%x\n",
 	      ahdrp->ah_sz,
-	      ( u_int )ahdrp->ah_valoff,
-	      ( u_int )ahdrp->ah_flags,
+	      ( uint )ahdrp->ah_valoff,
+	      ( uint )ahdrp->ah_flags,
 	      ahdrp->ah_valsz,
 	      ahdrp->ah_checksum );
 
diff --git a/restore/dirattr.c b/restore/dirattr.c
index d8d5140..7a423ab 100644
--- a/restore/dirattr.c
+++ b/restore/dirattr.c
@@ -71,7 +71,7 @@
 #define	HDLSUMMASK		( HDLSUMLOMASK << HDLSUMSHIFT )
 #define HDLDIXCNT		HDLSUMSHIFT
 #define HDLDIXMASK		( ( 1 << HDLDIXCNT ) - 1 )
-#define HDLGETSUM( h )		( ( u_int16_t )				\
+#define HDLGETSUM( h )		( ( uint16_t )				\
 				  ( ( ( int )h >> HDLSUMSHIFT )		\
 				    &					\
 				    HDLSUMLOMASK ))
@@ -104,8 +104,8 @@
  */
 struct dirattr {
 #ifdef DIRATTRCHK
-	u_int16_t d_unq;
-	u_int16_t d_sum; 
+	uint16_t d_unq;
+	uint16_t d_sum; 
 #endif /* DIRATTRCHK */
 	mode_t d_mode;
 	uid_t d_uid;
@@ -113,11 +113,11 @@ struct dirattr {
 	time32_t d_atime;
 	time32_t d_mtime;
 	time32_t d_ctime;
-	u_int32_t d_xflags;
-	u_int32_t d_extsize;
-	u_int32_t d_projid;
-	u_int32_t d_dmevmask;
-	u_int32_t d_dmstate;
+	uint32_t d_xflags;
+	uint32_t d_extsize;
+	uint32_t d_projid;
+	uint32_t d_dmevmask;
+	uint32_t d_dmstate;
 	off64_t d_extattroff;
 };
 
@@ -181,7 +181,7 @@ extern size_t pgsz;
 static void dirattr_get( dah_t );
 static void dirattr_cacheflush( void );
 #ifdef DIRATTRCHK
-static u_int16_t calcdixcum( dix_t dix );
+static uint16_t calcdixcum( dix_t dix );
 #endif /* DIRATTRCHK */
 
 
@@ -199,7 +199,7 @@ static dirattr_pers_t *dpp = 0;
 /* definition of locally defined global functions ****************************/
 
 bool_t
-dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
+dirattr_init( char *hkdir, bool_t resume, uint64_t dircnt )
 {
 	if ( dtp ) {
 		return BOOL_TRUE;
@@ -392,7 +392,7 @@ dirattr_add( filehdr_t *fhdrp )
 	off64_t oldoff;
 	dix_t dix;
 #ifdef DIRATTRCHK
-	u_int16_t sum;
+	uint16_t sum;
 #endif /* DIRATTRCHK */
 	dah_t dah;
 	
@@ -437,10 +437,10 @@ dirattr_add( filehdr_t *fhdrp )
 	dirattr.d_mtime = ( time32_t )fhdrp->fh_stat.bs_mtime.tv_sec;
 	dirattr.d_ctime = ( time32_t )fhdrp->fh_stat.bs_ctime.tv_sec;
 	dirattr.d_xflags = fhdrp->fh_stat.bs_xflags;
-	dirattr.d_extsize = ( u_int32_t )fhdrp->fh_stat.bs_extsize;
+	dirattr.d_extsize = ( uint32_t )fhdrp->fh_stat.bs_extsize;
 	dirattr.d_projid = bstat_projid(&(fhdrp->fh_stat));
 	dirattr.d_dmevmask = fhdrp->fh_stat.bs_dmevmask;
-	dirattr.d_dmstate = ( u_int32_t )fhdrp->fh_stat.bs_dmstate;
+	dirattr.d_dmstate = ( uint32_t )fhdrp->fh_stat.bs_dmstate;
 #ifdef DIRATTRCHK
 	dirattr.d_unq = DIRATTRUNQ;
 	sum = calcdixcum( dix );
@@ -753,7 +753,7 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 {
 	dix_t dix;
 #ifdef DIRATTRCHK
-	u_int16_t sum;
+	uint16_t sum;
 #endif /* DIRATTRCHK */
 	off64_t argoff;
 	off64_t newoff;
@@ -815,10 +815,10 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
 	dirattr.d_mtime = ( time32_t )fhdrp->fh_stat.bs_mtime.tv_sec;
 	dirattr.d_ctime = ( time32_t )fhdrp->fh_stat.bs_ctime.tv_sec;
 	dirattr.d_xflags = fhdrp->fh_stat.bs_xflags;
-	dirattr.d_extsize = ( u_int32_t )fhdrp->fh_stat.bs_extsize;
+	dirattr.d_extsize = ( uint32_t )fhdrp->fh_stat.bs_extsize;
 	dirattr.d_projid = bstat_projid(&(fhdrp->fh_stat));
 	dirattr.d_dmevmask = fhdrp->fh_stat.bs_dmevmask;
-	dirattr.d_dmstate = ( u_int32_t )fhdrp->fh_stat.bs_dmstate;
+	dirattr.d_dmstate = ( uint32_t )fhdrp->fh_stat.bs_dmstate;
 	dirattr.d_extattroff = DIRATTR_EXTATTROFFNULL;
 
 	/* write the dirattr
@@ -883,35 +883,35 @@ dirattr_get_ctime( dah_t dah )
 	return dtp->dt_cached_dirattr.d_ctime;
 }
 
-u_int32_t
+uint32_t
 dirattr_get_xflags( dah_t dah )
 {
 	dirattr_get( dah );
 	return dtp->dt_cached_dirattr.d_xflags;
 }
 
-u_int32_t
+uint32_t
 dirattr_get_extsize( dah_t dah )
 {
 	dirattr_get( dah );
 	return dtp->dt_cached_dirattr.d_extsize;
 }
 
-u_int32_t
+uint32_t
 dirattr_get_projid( dah_t dah )
 {
 	dirattr_get( dah );
 	return dtp->dt_cached_dirattr.d_projid;
 }
 
-u_int32_t
+uint32_t
 dirattr_get_dmevmask( dah_t dah )
 {
 	dirattr_get( dah );
 	return dtp->dt_cached_dirattr.d_dmevmask;
 }
 
-u_int32_t
+uint32_t
 dirattr_get_dmstate( dah_t dah )
 {
 	dirattr_get( dah );
@@ -960,7 +960,7 @@ dirattr_get( dah_t dah )
 	off64_t newoff;
 	int nread;
 #ifdef DIRATTRCHK
-	u_int16_t sum;
+	uint16_t sum;
 #endif /* DIRATTRCHK */
 
 	/* sanity checks
@@ -1036,7 +1036,7 @@ dirattr_cacheflush( void )
 	dah_t dah;
 	dix_t dix;
 #ifdef DIRATTRCHK
-	u_int16_t sum;
+	uint16_t sum;
 #endif /* DIRATTRCHK */
 	off64_t argoff;
 	off64_t newoff;
@@ -1103,10 +1103,10 @@ dirattr_cacheflush( void )
 
 #ifdef DIRATTRCHK
 
-static u_int16_t
+static uint16_t
 calcdixcum( dix_t dix )
 {
-	u_int16_t sum;
+	uint16_t sum;
 	ix_t nibcnt;
 	ix_t nibix;
 
@@ -1115,10 +1115,10 @@ calcdixcum( dix_t dix )
 	nibcnt = ( sizeof( dah_t ) / HDLSUMCNT ) - 1;
 	sum = 0;
 	for ( nibix = 0 ; nibix < nibcnt ; nibix++ ) {
-		sum += ( u_int16_t )( dix & HDLSUMLOMASK );
+		sum += ( uint16_t )( dix & HDLSUMLOMASK );
 		dix >>= HDLSUMCNT;
 	}
-	sum = ( u_int16_t )( ( ~sum + 1 ) & HDLSUMLOMASK );
+	sum = ( uint16_t )( ( ~sum + 1 ) & HDLSUMLOMASK );
 
 	return sum;
 }
diff --git a/restore/dirattr.h b/restore/dirattr.h
index d671883..aaf276d 100644
--- a/restore/dirattr.h
+++ b/restore/dirattr.h
@@ -33,7 +33,7 @@ typedef size32_t dah_t;
  */
 extern bool_t dirattr_init( char *housekeepingdir,
 			    bool_t resync,
-			    u_int64_t dircnt );
+			    uint64_t dircnt );
 
 
 /* dirattr_cleanup - removes all traces
@@ -62,11 +62,11 @@ gid_t dirattr_get_gid( dah_t dah );
 time32_t dirattr_get_atime( dah_t dah );
 time32_t dirattr_get_mtime( dah_t dah );
 time32_t dirattr_get_ctime( dah_t dah );
-u_int32_t dirattr_get_xflags( dah_t dah );
-u_int32_t dirattr_get_extsize( dah_t dah );
-u_int32_t dirattr_get_projid( dah_t dah );
-u_int32_t dirattr_get_dmevmask( dah_t dah );
-u_int32_t dirattr_get_dmstate( dah_t dah );
+uint32_t dirattr_get_xflags( dah_t dah );
+uint32_t dirattr_get_extsize( dah_t dah );
+uint32_t dirattr_get_projid( dah_t dah );
+uint32_t dirattr_get_dmevmask( dah_t dah );
+uint32_t dirattr_get_dmstate( dah_t dah );
 
 /* dirattr_flush - flush dirattr I/O buffer.  Returns 0 if successful.
  */
diff --git a/restore/inomap.c b/restore/inomap.c
index f1604c4..fd55907 100644
--- a/restore/inomap.c
+++ b/restore/inomap.c
@@ -92,8 +92,8 @@ static int pers_fd = -1;
 
 /* context for inomap construction - initialized by inomap_restore_pers
  */
-static u_int64_t hnkcnt;
-static u_int64_t segcnt;
+static uint64_t hnkcnt;
+static uint64_t segcnt;
 static hnk_t *roothnkp = 0;
 static hnk_t *tailhnkp;
 static seg_t *lastsegp;
@@ -106,10 +106,10 @@ static inline void
 SEG_SET_BITS( seg_t *segp, xfs_ino_t ino, int state )
 {
 	register xfs_ino_t relino;
-	register u_int64_t mask;
-	register u_int64_t clrmask;
+	register uint64_t mask;
+	register uint64_t clrmask;
 	relino = ino - segp->base;
-	mask = ( u_int64_t )1 << relino;
+	mask = ( uint64_t )1 << relino;
 	clrmask = ~mask;
 	switch( state ) {
 	case 0:
@@ -160,9 +160,9 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
 {
 	int state;
 	register xfs_ino_t relino;
-	register u_int64_t mask;
+	register uint64_t mask;
 	relino = ino - segp->base;
-	mask = ( u_int64_t )1 << relino;
+	mask = ( uint64_t )1 << relino;
 	if ( segp->lobits & mask ) {
 		state = 1;
 	} else {
@@ -310,7 +310,7 @@ rv_t
 inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp )
 {
 	drive_ops_t *dop = drivep->d_opsp;
-	u_int64_t tmphnkcnt;
+	uint64_t tmphnkcnt;
 	/* REFERENCED */
 	int nread;
 	int rval;
@@ -654,10 +654,10 @@ map_getset( xfs_ino_t ino, int newstate, bool_t setflag )
 static seg_t *
 map_getsegment( xfs_ino_t ino )
 {
-	u_int64_t min;
-	u_int64_t max;
-	u_int64_t hnk;
-	u_int64_t seg;
+	uint64_t min;
+	uint64_t max;
+	uint64_t hnk;
+	uint64_t seg;
 
 	/* Use binary search to find the hunk that contains the inode number,
 	 * if any.  This counts on the fact that all the hunks are contiguous
diff --git a/restore/inomap.h b/restore/inomap.h
index bc40f3e..03facdb 100644
--- a/restore/inomap.h
+++ b/restore/inomap.h
@@ -48,9 +48,9 @@
  */
 struct seg {
 	xfs_ino_t base;
-	u_int64_t lobits;
-	u_int64_t mebits;
-	u_int64_t hibits;
+	uint64_t lobits;
+	uint64_t mebits;
+	uint64_t hibits;
 };
 
 typedef struct seg seg_t;
diff --git a/restore/namreg.c b/restore/namreg.c
index 8c3b74f..97e6524 100644
--- a/restore/namreg.c
+++ b/restore/namreg.c
@@ -116,7 +116,7 @@ static namreg_pers_t *npp = 0;
 /* definition of locally defined global functions ****************************/
 
 bool_t
-namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
+namreg_init( char *hkdir, bool_t resume, uint64_t inocnt )
 {
 	if ( ntp ) {
 		return BOOL_TRUE;
diff --git a/restore/namreg.h b/restore/namreg.h
index 8bc7b53..859ccd7 100644
--- a/restore/namreg.h
+++ b/restore/namreg.h
@@ -36,7 +36,7 @@ typedef size64_t nrh_t;
  */
 extern bool_t namreg_init( char *housekeepingdir,
 			   bool_t resync,
-			   u_int64_t inocnt );
+			   uint64_t inocnt );
 
 
 /* namreg_add - registers a name. name does not need to be null-terminated.
diff --git a/restore/tree.c b/restore/tree.c
index 46ba715..363f0f1 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -349,7 +349,7 @@ tree_init( char *hkdir,
 	   bool_t fullpr,
 	   bool_t restoredmpr,
 	   bool_t dstdirisxfspr,
-	   u_int32_t dumpformat,
+	   uint32_t dumpformat,
 	   bool_t truncategenpr )
 {
 	off64_t nodeoff;
@@ -661,7 +661,7 @@ tree_sync( char *hkdir,
 }
 
 bool_t
-tree_check_dump_format( u_int32_t dumpformat )
+tree_check_dump_format( uint32_t dumpformat )
 {
 	if ( dumpformat < GLOBAL_HDR_VERSION_3 && !persp->p_truncategenpr ) {
 		mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_TREE, _(
@@ -2554,7 +2554,7 @@ setdirattr( dah_t dah, char *path )
 
 		fssetdm.fsd_dmevmask = dirattr_get_dmevmask( dah );
 		fssetdm.fsd_padding = 0;	/* not used */
-		fssetdm.fsd_dmstate = ( u_int16_t )dirattr_get_dmstate( dah );
+		fssetdm.fsd_dmstate = ( uint16_t )dirattr_get_dmstate( dah );
 
 		/* restore DMAPI event settings etc.
 		 */
diff --git a/restore/tree.h b/restore/tree.h
index 7b1a76a..47911c4 100644
--- a/restore/tree.h
+++ b/restore/tree.h
@@ -33,7 +33,7 @@ extern bool_t tree_init( char *hkdir,
 			 bool_t fullpr,
 			 bool_t restoredmpr,
 			 bool_t dstdirisxfspr,
-			 u_int32_t dumpformat,
+			 uint32_t dumpformat,
 			 bool_t truncategenpr );
 
 /* tree_sync - synchronizes with an existing tree abstraction
@@ -50,7 +50,7 @@ extern bool_t tree_sync( char *hkdir,
  * a format 2 dump. the restore will fail unless the
  * original restore was told to use format 2 gen numbers.
  */
-extern bool_t tree_check_dump_format( u_int32_t dumpformat );
+extern bool_t tree_check_dump_format( uint32_t dumpformat );
 
 
 /* tree_begindir - begins application of dumped directory to tree.
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/8] cleanup: define a local xfs_ino_t
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (3 preceding siblings ...)
  2015-10-16  1:44 ` [PATCH 4/8] cleanup: kill u_int*_t types Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-16  1:44 ` [PATCH 6/8] cleanup: use system uuid.h headers Dave Chinner
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

The xfs inode number size is never going to change - it's a
uint64_t. We currently inherit this from xfsprogs headers, but it
goes away in xfsprogs v4.2.0 as it's part of the platform
definitions. Add our own local definition for this type.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/types.h b/common/types.h
index 235f52a..0923897 100644
--- a/common/types.h
+++ b/common/types.h
@@ -49,6 +49,8 @@ typedef unsigned long u_long_t;
 typedef size_t ix_t;
 typedef int32_t time32_t;
 
+typedef uint64_t xfs_ino_t;
+
 /* limits
  */
 #define	MKMAX( t, s )	( ( t )						\
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/8] cleanup: use system uuid.h headers
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (4 preceding siblings ...)
  2015-10-16  1:44 ` [PATCH 5/8] cleanup: define a local xfs_ino_t Dave Chinner
@ 2015-10-16  1:44 ` Dave Chinner
  2015-10-16  1:45 ` [PATCH 7/8] cleanup: move fold_t out of util.h Dave Chinner
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:44 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

Another bunch of support pulled in from the xfs headers, but would
never have worked correctly on any platform other than Linux as dump
doe snot use the abstractions that xfsprogs wraps around the uuid
interfaces. Hence just make it work on Linux for now, as it's
already relying on native support.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/fs.c           | 1 +
 common/global.c       | 1 +
 common/inventory.c    | 1 +
 dump/content.c        | 1 +
 dump/var.c            | 1 +
 inventory/inv_api.c   | 1 +
 inventory/inv_fstab.c | 1 +
 inventory/inv_mgr.c   | 1 +
 inventory/inv_stobj.c | 1 +
 inventory/testmain.c  | 1 +
 invutil/cmenu.c       | 1 +
 invutil/fstab.c       | 1 +
 invutil/invidx.c      | 1 +
 invutil/invutil.c     | 1 +
 invutil/list.c        | 1 +
 invutil/menu.c        | 1 +
 invutil/screen.c      | 1 +
 invutil/stobj.c       | 1 +
 restore/content.c     | 1 +
 19 files changed, 19 insertions(+)

diff --git a/common/fs.c b/common/fs.c
index 184f08d..e600e38 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -30,6 +30,7 @@
 #include <sys/ioctl.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/common/global.c b/common/global.c
index ea7ad6d..ca11368 100644
--- a/common/global.c
+++ b/common/global.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/common/inventory.c b/common/inventory.c
index 83e1ebb..d1b810c 100644
--- a/common/inventory.c
+++ b/common/inventory.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <assert.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "inventory_priv.h"
diff --git a/dump/content.c b/dump/content.c
index fcd7dd7..15fb357 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -34,6 +34,7 @@
 #include <malloc.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #ifdef linux
 #include <xfs/xqm.h>
diff --git a/dump/var.c b/dump/var.c
index d3fa3be..6dd6a70 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <dirent.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/inventory/inv_api.c b/inventory/inv_api.c
index 888c425..acca40b 100644
--- a/inventory/inv_api.c
+++ b/inventory/inv_api.c
@@ -30,6 +30,7 @@
 #include <sys/stat.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
index 1c2bf3d..56d6b8f 100644
--- a/inventory/inv_fstab.c
+++ b/inventory/inv_fstab.c
@@ -29,6 +29,7 @@
 #include <sys/dir.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
index e521f24..79d4bb1 100644
--- a/inventory/inv_mgr.c
+++ b/inventory/inv_mgr.c
@@ -27,6 +27,7 @@
 #include <sys/dir.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
index 0763d0b..9619476 100644
--- a/inventory/inv_stobj.c
+++ b/inventory/inv_stobj.c
@@ -30,6 +30,7 @@
 #include <sys/mman.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/inventory/testmain.c b/inventory/testmain.c
index 3f742e4..ecddf54 100644
--- a/inventory/testmain.c
+++ b/inventory/testmain.c
@@ -24,6 +24,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <assert.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/invutil/cmenu.c b/invutil/cmenu.c
index ce23d28..e60fd22 100644
--- a/invutil/cmenu.c
+++ b/invutil/cmenu.c
@@ -25,6 +25,7 @@
 #include <signal.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/fstab.c b/invutil/fstab.c
index ac8f775..4284cd1 100644
--- a/invutil/fstab.c
+++ b/invutil/fstab.c
@@ -25,6 +25,7 @@
 #include <ncurses.h>
 #include <sys/mman.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/invidx.c b/invutil/invidx.c
index 44c5e7f..67efdf7 100644
--- a/invutil/invidx.c
+++ b/invutil/invidx.c
@@ -26,6 +26,7 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/invutil.c b/invutil/invutil.c
index e1c8868..06bdeda 100644
--- a/invutil/invutil.c
+++ b/invutil/invutil.c
@@ -28,6 +28,7 @@
 #include <sys/mman.h>
 #include <string.h>
 #include <libgen.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/invutil/list.c b/invutil/list.c
index 0157102..ae5d9b7 100644
--- a/invutil/list.c
+++ b/invutil/list.c
@@ -19,6 +19,7 @@
 #include <xfs/xfs.h>
 #include <xfs/jdm.h>
 #include <ncurses.h>
+#include <uuid/uuid.h>
 
 #include "list.h"
 #include "cmenu.h"
diff --git a/invutil/menu.c b/invutil/menu.c
index a0d2d0e..c050359 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -20,6 +20,7 @@
 #include <xfs/jdm.h>
 #include <ncurses.h>
 #include <ctype.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "cmenu.h"
diff --git a/invutil/screen.c b/invutil/screen.c
index c4b79d8..6e913a7 100644
--- a/invutil/screen.c
+++ b/invutil/screen.c
@@ -22,6 +22,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <ncurses.h>
+#include <uuid/uuid.h>
 
 #include "cmenu.h"
 
diff --git a/invutil/stobj.c b/invutil/stobj.c
index eb04385..f389c53 100644
--- a/invutil/stobj.c
+++ b/invutil/stobj.c
@@ -25,6 +25,7 @@
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "types.h"
 #include "mlog.h"
diff --git a/restore/content.c b/restore/content.c
index 5e6e88e..d4fe350 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -38,6 +38,7 @@
 #include <pthread.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 7/8] cleanup: move fold_t out of util.h
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (5 preceding siblings ...)
  2015-10-16  1:44 ` [PATCH 6/8] cleanup: use system uuid.h headers Dave Chinner
@ 2015-10-16  1:45 ` Dave Chinner
  2015-10-16  1:45 ` [PATCH 8/8] cleanup: Kill unnecessary xfs includes Dave Chinner
  2015-10-28 11:51 ` [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Brian Foster
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:45 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

Many files just want the fold_t type, but pulling in util.h requires
all the XFS and JDM headers to be pulled in, too. Move fold_t to
mlog.[ch] as it tends to be common with log output. Similarly, move
the PREEMPT_* definitions to common/types.h to remove that
dependency on util.h as well.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/mlog.c  | 45 +++++++++++++++++++++++++++++++++++++++++++++
 common/mlog.h  |  6 ++++++
 common/types.h |  5 +++++
 common/util.c  | 45 ---------------------------------------------
 common/util.h  | 11 -----------
 5 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/common/mlog.c b/common/mlog.c
index fd21c18..c8b3129 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -802,3 +802,48 @@ mlog_sym_lookup( char *sym )
 
 	return -1;
 }
+
+void
+fold_init( fold_t fold, char *infostr, char c )
+{
+	size_t infolen;
+	size_t dashlen;
+	size_t predashlen;
+	size_t postdashlen;
+	char *p;
+	char *endp;
+	ix_t cnt;
+
+	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
+
+	infolen = strlen( infostr );
+	if ( infolen > FOLD_LEN - 4 ) {
+		infolen = FOLD_LEN - 4;
+	}
+	dashlen = FOLD_LEN - infolen - 3;
+	predashlen = dashlen / 2;
+	postdashlen = dashlen - predashlen;
+
+	p = &fold[ 0 ];
+	endp = &fold[ sizeof( fold_t ) - 1 ];
+
+	assert( p < endp );
+	*p++ = ' ';
+	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
+		*p = c;
+	}
+	assert( p < endp );
+	*p++ = ' ';
+	assert( p < endp );
+	assert( p + infolen < endp );
+	strcpy( p, infostr );
+	p += infolen;
+	assert( p < endp );
+	*p++ = ' ';
+	assert( p < endp );
+	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
+		*p = c;
+	}
+	assert( p <= endp );
+	*p = 0;
+}
diff --git a/common/mlog.h b/common/mlog.h
index d7bbfce..e080f9e 100644
--- a/common/mlog.h
+++ b/common/mlog.h
@@ -123,4 +123,10 @@ extern void mlog_exit_flush( void );
 extern void mlog_lock( void );
 extern void mlog_unlock( void );
 
+/* fold_t - a character string made to look like a "fold here"
+ */
+#define FOLD_LEN	79
+typedef char fold_t[ FOLD_LEN + 1 ];
+extern void fold_init( fold_t fold, char *infostr, char c );
+
 #endif /* MLOG_H */
diff --git a/common/types.h b/common/types.h
index 0923897..f902828 100644
--- a/common/types.h
+++ b/common/types.h
@@ -136,4 +136,9 @@ typedef struct stat64 stat64_t;
 typedef struct getbmapx getbmapx_t;
 typedef struct fsdmidata fsdmidata_t;
 
+/* flg definitions for preemptchk 
+ */
+#define PREEMPT_FULL		0
+#define PREEMPT_PROGRESSONLY	1
+
 #endif /* TYPES_H */
diff --git a/common/util.c b/common/util.c
index 93dd9c8..0d49d5c 100644
--- a/common/util.c
+++ b/common/util.c
@@ -532,48 +532,3 @@ cvtnum( int blocksize, char *s )
 		return 1024 * 1024 * i;
 	return -1;
 }
-
-void
-fold_init( fold_t fold, char *infostr, char c )
-{
-	size_t infolen;
-	size_t dashlen;
-	size_t predashlen;
-	size_t postdashlen;
-	char *p;
-	char *endp;
-	ix_t cnt;
-
-	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
-
-	infolen = strlen( infostr );
-	if ( infolen > FOLD_LEN - 4 ) {
-		infolen = FOLD_LEN - 4;
-	}
-	dashlen = FOLD_LEN - infolen - 3;
-	predashlen = dashlen / 2;
-	postdashlen = dashlen - predashlen;
-
-	p = &fold[ 0 ];
-	endp = &fold[ sizeof( fold_t ) - 1 ];
-
-	assert( p < endp );
-	*p++ = ' ';
-	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
-		*p = c;
-	}
-	assert( p < endp );
-	*p++ = ' ';
-	assert( p < endp );
-	assert( p + infolen < endp );
-	strcpy( p, infostr );
-	p += infolen;
-	assert( p < endp );
-	*p++ = ' ';
-	assert( p < endp );
-	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
-		*p = c;
-	}
-	assert( p <= endp );
-	*p = 0;
-}
diff --git a/common/util.h b/common/util.h
index 5284811..558bf7e 100644
--- a/common/util.h
+++ b/common/util.h
@@ -143,22 +143,11 @@ extern int diriter( jdm_fshandle_t *fshandlep,
 			 size_t usrgdsz );
 
 
-/* fold_t - a character string made to look like a "fold here"
- */
-#define FOLD_LEN	79
-typedef char fold_t[ FOLD_LEN + 1 ];
-extern void fold_init( fold_t fold, char *infostr, char c );
-
 
 /* macro to copy uuid structures
  */
 #define COPY_LABEL( lab1, lab2) ( bcopy( lab1, lab2, GLOBAL_HDR_STRING_SZ) )
 
-/* flg definitions for preemptchk 
- */
-#define PREEMPT_FULL		0
-#define PREEMPT_PROGRESSONLY	1
-
 /*
  * Align pointer up to alignment
  */
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 8/8] cleanup: Kill unnecessary xfs includes
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (6 preceding siblings ...)
  2015-10-16  1:45 ` [PATCH 7/8] cleanup: move fold_t out of util.h Dave Chinner
@ 2015-10-16  1:45 ` Dave Chinner
  2015-10-28 11:51 ` [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Brian Foster
  8 siblings, 0 replies; 17+ messages in thread
From: Dave Chinner @ 2015-10-16  1:45 UTC (permalink / raw)
  To: xfs

From: Dave Chinner <dchinner@redhat.com>

Remove all the unneccessary xfsprogs header includes by replacing
them with explicit includes and platform specific definitions in
config.h.in.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
---
 common/arch_xlate.c     |  7 +++----
 common/arch_xlate.h     |  3 ---
 common/cldmgr.c         |  3 ---
 common/content_common.c |  6 ++----
 common/dlog.c           |  4 +---
 common/drive.c          |  7 +++----
 common/drive_minrmt.c   |  6 ++----
 common/drive_scsitape.c |  6 ++----
 common/drive_simple.c   |  6 +++++-
 common/fs.c             |  3 +--
 common/global.c         |  7 +++----
 common/hsmapi.c         | 13 +++++++++++--
 common/hsmapi.h         | 12 ++++++------
 common/lock.c           |  4 +---
 common/main.c           |  7 +++----
 common/media.c          |  3 ---
 common/mlog.c           |  6 ++----
 common/openutil.c       |  3 +--
 common/path.c           |  2 --
 common/qlock.c          |  4 +---
 common/ring.c           |  3 ---
 common/stream.c         |  3 ---
 common/types.h          |  9 +++++++++
 common/util.c           |  6 ++----
 dump/content.c          |  5 ++---
 dump/inomap.c           |  6 ++----
 dump/inomap.h           |  5 +++--
 dump/var.c              |  3 ---
 include/config.h.in     |  4 ++++
 inventory/inv_files.c   |  3 ---
 invutil/list.c          |  3 +--
 invutil/menu.c          |  3 +--
 restore/bag.c           |  3 ---
 restore/content.c       |  7 +++----
 restore/mmap.c          |  1 -
 restore/tree.c          |  9 +++++----
 restore/win.c           |  3 ---
 37 files changed, 79 insertions(+), 109 deletions(-)

diff --git a/common/arch_xlate.c b/common/arch_xlate.c
index f8aa50f..1b8e687 100644
--- a/common/arch_xlate.c
+++ b/common/arch_xlate.c
@@ -16,11 +16,10 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-#include <assert.h>
-
+#include <sys/param.h>
 #include <strings.h>
+#include <assert.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
diff --git a/common/arch_xlate.h b/common/arch_xlate.h
index fa201cd..80e847f 100644
--- a/common/arch_xlate.h
+++ b/common/arch_xlate.h
@@ -19,9 +19,6 @@
 #ifndef ARCH_XLATE_H
 #define ARCH_XLATE_H
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <strings.h>
 #include "types.h"
 #include "global.h"
diff --git a/common/cldmgr.c b/common/cldmgr.c
index 624da62..2890092 100644
--- a/common/cldmgr.c
+++ b/common/cldmgr.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <sys/wait.h>
 #include <sys/ipc.h>
diff --git a/common/content_common.c b/common/content_common.c
index 99b1a4b..8f84e56 100644
--- a/common/content_common.c
+++ b/common/content_common.c
@@ -16,9 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdio.h>
 #include <unistd.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -27,11 +25,11 @@
 #include <signal.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
 #include "mlog.h"
 #include "dlog.h"
 #include "cldmgr.h"
diff --git a/common/dlog.c b/common/dlog.c
index cb5c11a..032e6f7 100644
--- a/common/dlog.c
+++ b/common/dlog.c
@@ -16,9 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
diff --git a/common/drive.c b/common/drive.c
index 9fb0bb7..5fe6867 100644
--- a/common/drive.c
+++ b/common/drive.c
@@ -16,18 +16,17 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdio.h>
+#include <unistd.h>
 #include <sys/stat.h>
 #include <time.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
 #include "mlog.h"
 #include "dlog.h"
 #include "path.h"
diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
index 848d794..32dc404 100644
--- a/common/drive_minrmt.c
+++ b/common/drive_minrmt.c
@@ -16,12 +16,10 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
 #include <sys/prctl.h>
@@ -33,11 +31,11 @@
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
 #include "qlock.h"
 #include "cldmgr.h"
 #include "mlog.h"
diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
index 06ba2f4..56b8c2d 100644
--- a/common/drive_scsitape.c
+++ b/common/drive_scsitape.c
@@ -16,12 +16,10 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
 #include <sys/prctl.h>
@@ -33,11 +31,11 @@
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
 #include "qlock.h"
 #include "cldmgr.h"
 #include "mlog.h"
diff --git a/common/drive_simple.c b/common/drive_simple.c
index 45bc28c..b4e41da 100644
--- a/common/drive_simple.c
+++ b/common/drive_simple.c
@@ -22,6 +22,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <fcntl.h>
 #include <time.h>
 #include <errno.h>
@@ -29,11 +30,14 @@
 #include <sched.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
+#include <xfs/xfs.h>
+#include <xfs/jdm.h>	/* needed only for util.h include */
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
+#include "util.h"	/* needed onyl for I/O routines */
 #include "stream.h"
 #include "mlog.h"
 #include "global.h"
diff --git a/common/fs.c b/common/fs.c
index e600e38..60cf0fd 100644
--- a/common/fs.c
+++ b/common/fs.c
@@ -16,8 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
 #include "config.h"
 
 #include <unistd.h>
@@ -31,6 +29,7 @@
 #include <assert.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <xfs/xfs.h>
 
 #include "config.h"
 
diff --git a/common/global.c b/common/global.c
index ca11368..e70b8a0 100644
--- a/common/global.c
+++ b/common/global.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <sys/stat.h>
 #include <time.h>
@@ -26,11 +23,13 @@
 #include <assert.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <xfs/xfs.h>
+#include <xfs/jdm.h> /* only for util.h include */
 
 #include "config.h"
 
 #include "types.h"
-#include "util.h"
+#include "util.h" /* only for strncpyterm */
 #include "mlog.h"
 #include "dlog.h"
 #include "global.h"
diff --git a/common/hsmapi.c b/common/hsmapi.c
index 489223d..6054773 100644
--- a/common/hsmapi.c
+++ b/common/hsmapi.c
@@ -16,15 +16,24 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <uuid/uuid.h>
 #include <attr/attributes.h>
+#include <xfs/xfs.h>
 #include <xfs/jdm.h>
-#include <assert.h>
 
 #include <string.h>
 
 #include "config.h"
 
+#include "types.h"
 #include "hsmapi.h"
 #include "mlog.h"
 
diff --git a/common/hsmapi.h b/common/hsmapi.h
index b6d035d..63933af 100644
--- a/common/hsmapi.h
+++ b/common/hsmapi.h
@@ -19,13 +19,13 @@
 #ifndef HSMAPI_H
 #define HSMAPI_H
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
 #include "types.h"
 #include "global.h"
 #include "content.h"
 #include "content_inode.h"
 
+struct xfs_bstat;
+
 #define	HSM_API_VERSION_1	1	/* only version supported so far */
 
 typedef	void	hsm_fs_ctxt_t;		/* opaque HSM filesystem context */
@@ -94,7 +94,7 @@ extern int
 HsmEstimateFileSpace(
 	hsm_fs_ctxt_t	*fscontextp,
 	hsm_f_ctxt_t	*fcontextp,
-const	xfs_bstat_t	*statp,
+const	struct xfs_bstat	*statp,
 	off64_t		*bytes,
 	int		accurate);
 
@@ -117,7 +117,7 @@ const	xfs_bstat_t	*statp,
 extern int
 HsmEstimateFileOffset(
 	hsm_fs_ctxt_t	*contextp,
-const	xfs_bstat_t	*statp,
+const	struct xfs_bstat	*statp,
 	off64_t		bytecount,
 	off64_t		*byteoffset);
 
@@ -181,7 +181,7 @@ HsmDeleteFileContext(
 extern int
 HsmInitFileContext(
 	hsm_f_ctxt_t	*contextp,
-const	xfs_bstat_t	*statp);
+const	struct xfs_bstat	*statp);
 
 
 /******************************************************************************
@@ -201,7 +201,7 @@ const	xfs_bstat_t	*statp);
 extern int
 HsmModifyInode(
 	hsm_f_ctxt_t	*contextp,
-	xfs_bstat_t	*statp);
+	struct xfs_bstat	*statp);
 
 
 /******************************************************************************
diff --git a/common/lock.c b/common/lock.c
index a237931..9826581 100644
--- a/common/lock.c
+++ b/common/lock.c
@@ -15,10 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
 #include <assert.h>
+#include <sys/types.h>
 
 #include "config.h"
 
diff --git a/common/main.c b/common/main.c
index e381e85..3848499 100644
--- a/common/main.c
+++ b/common/main.c
@@ -16,12 +16,11 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <sys/wait.h>
 #include <sys/prctl.h>
 #include <sys/resource.h>
@@ -37,6 +36,7 @@
 #include <pthread.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
@@ -44,7 +44,6 @@
 #include "types.h"
 #include "stream.h"
 #include "cldmgr.h"
-#include "util.h"
 #include "getopt.h"
 #include "mlog.h"
 #include "qlock.h"
diff --git a/common/media.c b/common/media.c
index fceb78d..02fde9c 100644
--- a/common/media.c
+++ b/common/media.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <time.h>
diff --git a/common/mlog.c b/common/mlog.c
index c8b3129..b520131 100644
--- a/common/mlog.c
+++ b/common/mlog.c
@@ -16,19 +16,18 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <sys/types.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/types.h>
 #include <time.h>
 #include <getopt.h>
 #include <pthread.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
 
 #include "config.h"
 
@@ -39,7 +38,6 @@
 #include "cldmgr.h"
 #include "getopt.h"
 #include "exit.h"
-#include "util.h"
 #include "global.h"
 #include "drive.h"
 
diff --git a/common/openutil.c b/common/openutil.c
index 6cc0efa..fcb52fc 100644
--- a/common/openutil.c
+++ b/common/openutil.c
@@ -15,9 +15,8 @@
  * along with this program; if not, write the Free Software Foundation,
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
 
+#include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
diff --git a/common/path.c b/common/path.c
index b73121d..b234de1 100644
--- a/common/path.c
+++ b/common/path.c
@@ -16,9 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
 #include <assert.h>
-
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
diff --git a/common/qlock.c b/common/qlock.c
index 0583a63..c770116 100644
--- a/common/qlock.c
+++ b/common/qlock.c
@@ -16,9 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdlib.h>
 #include <pthread.h>
 #include <semaphore.h>
 #include <assert.h>
diff --git a/common/ring.c b/common/ring.c
index bb90901..f5055ee 100644
--- a/common/ring.c
+++ b/common/ring.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <errno.h>
diff --git a/common/stream.c b/common/stream.c
index 549bf59..3047886 100644
--- a/common/stream.c
+++ b/common/stream.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <pthread.h>
 #include <assert.h>
 #include <string.h>
diff --git a/common/types.h b/common/types.h
index f902828..ebdacdd 100644
--- a/common/types.h
+++ b/common/types.h
@@ -23,6 +23,13 @@
  */
 #include <stdint.h>
 
+/*
+ * type macros that were naively put into xfs/jdm.h, then used in places that
+ * have nothing to do with file handle operations.
+ */
+#define sizeofmember( t, m )	sizeof( ( ( t * )0 )->m )
+#define offsetofmember( t, m )	( ( size_t )( char * )&( ( ( t * )0 )->m ) )
+
 #define XFSDUMP_DIRPATH	inv_basepath()
 
 /*
@@ -51,6 +58,8 @@ typedef int32_t time32_t;
 
 typedef uint64_t xfs_ino_t;
 
+#define constpp        char * const *
+
 /* limits
  */
 #define	MKMAX( t, s )	( ( t )						\
diff --git a/common/util.c b/common/util.c
index 0d49d5c..bbca758 100644
--- a/common/util.c
+++ b/common/util.c
@@ -16,10 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-#include "config.h"
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -29,6 +25,8 @@
 #include <dirent.h>
 #include <assert.h>
 #include <string.h>
+#include <xfs/xfs.h>
+#include <xfs/jdm.h>
 
 #include "config.h"
 
diff --git a/dump/content.c b/dump/content.c
index 15fb357..1e86292 100644
--- a/dump/content.c
+++ b/dump/content.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -36,6 +33,8 @@
 #include <string.h>
 #include <uuid/uuid.h>
 
+#include <xfs/xfs.h>
+#include <xfs/jdm.h>
 #ifdef linux
 #include <xfs/xqm.h>
 #endif
diff --git a/dump/inomap.c b/dump/inomap.c
index 4e57a78..1dacf35 100644
--- a/dump/inomap.c
+++ b/dump/inomap.c
@@ -16,10 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-#include <malloc.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
@@ -29,6 +25,8 @@
 #include <sys/ioctl.h>
 #include <assert.h>
 #include <string.h>
+#include <xfs/xfs.h>
+#include <xfs/jdm.h>
 
 #include "config.h"
 
diff --git a/dump/inomap.h b/dump/inomap.h
index f222642..fb9bbf7 100644
--- a/dump/inomap.h
+++ b/dump/inomap.h
@@ -29,6 +29,7 @@
  * the 64 inos beginning with the starting ino. two bits are available
  * for each ino.
  */
+struct xfs_bstat;
 
 /* inomap_build - this function allocates and constructs an in-memory
  * representation of the bitmap. it prunes from the map inos of files not
@@ -46,9 +47,9 @@
  * fall at file boundaries. returns BOOL_FALSE if error encountered (should
  * abort the dump; else returns BOOL_TRUE.
  */
-extern bool_t inomap_build( jdm_fshandle_t *fshandlep,
+extern bool_t inomap_build( void *fshandlep,
 			    int fsfd,
-			    xfs_bstat_t *rootstatp,
+			    struct xfs_bstat *rootstatp,
 			    bool_t last,
 	      		    time32_t lasttime,
 			    bool_t resume,
diff --git a/dump/var.c b/dump/var.c
index 6dd6a70..645caab 100644
--- a/dump/var.c
+++ b/dump/var.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/stat.h>
diff --git a/include/config.h.in b/include/config.h.in
index ef66ed9..3b35d83 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -46,4 +46,8 @@ typedef unsigned short umode_t;
 #define max(a,b)	(((a)>(b))?(a):(b))
 #endif
 
+#ifndef NBBY
+#define NBBY 8
+#endif
+
 #endif	/* __CONFIG_H__ */
diff --git a/inventory/inv_files.c b/inventory/inv_files.c
index 409ee0d..46f6b8f 100644
--- a/inventory/inv_files.c
+++ b/inventory/inv_files.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <time.h>
 #include <errno.h>
 #include <sys/stat.h>
diff --git a/invutil/list.c b/invutil/list.c
index ae5d9b7..46fb291 100644
--- a/invutil/list.c
+++ b/invutil/list.c
@@ -16,8 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
+#include <stdlib.h>
 #include <ncurses.h>
 #include <uuid/uuid.h>
 
diff --git a/invutil/menu.c b/invutil/menu.c
index c050359..f81f9b6 100644
--- a/invutil/menu.c
+++ b/invutil/menu.c
@@ -16,8 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
+#include <errno.h>
 #include <ncurses.h>
 #include <ctype.h>
 #include <uuid/uuid.h>
diff --git a/restore/bag.c b/restore/bag.c
index 3927877..55bba73 100644
--- a/restore/bag.c
+++ b/restore/bag.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <sys/types.h>
 #include <stdlib.h>
 #include <memory.h>
diff --git a/restore/content.c b/restore/content.c
index d4fe350..7c4a81f 100644
--- a/restore/content.c
+++ b/restore/content.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <sys/socket.h>
@@ -39,12 +36,14 @@
 #include <assert.h>
 #include <string.h>
 #include <uuid/uuid.h>
+#include <xfs/xfs.h>
+#include <xfs/jdm.h>	/* only for util.h */
 
 #include "config.h"
 
 #include "types.h"
 #include "timeutil.h"
-#include "util.h"
+#include "util.h"	/* only for r/w routines, ALIGN_PTR */
 #include "cldmgr.h"
 #include "qlock.h"
 #include "lock.h"
diff --git a/restore/mmap.c b/restore/mmap.c
index e8536c2..29dd3d7 100644
--- a/restore/mmap.c
+++ b/restore/mmap.c
@@ -16,7 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
 #include <unistd.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
diff --git a/restore/tree.c b/restore/tree.c
index 363f0f1..0336e77 100644
--- a/restore/tree.c
+++ b/restore/tree.c
@@ -16,13 +16,13 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
+#include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <errno.h>
 #include <sys/mman.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/ioctl.h>
@@ -34,12 +34,13 @@
 #include <sys/ioctl.h>
 #include <assert.h>
 #include <string.h>
+#include <uuid/uuid.h>
+#include <xfs/xfs.h>
 
 #include "config.h"
 
 #include "types.h"
 #include "exit.h"
-#include "util.h"
 #include "cldmgr.h"
 #include "path.h"
 #include "openutil.h"
diff --git a/restore/win.c b/restore/win.c
index e6c0be3..e5bf708 100644
--- a/restore/win.c
+++ b/restore/win.c
@@ -16,9 +16,6 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <xfs/xfs.h>
-#include <xfs/jdm.h>
-
 #include <sys/types.h>
 #include <sys/mman.h>
 #include <time.h>
-- 
2.5.0

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-16  1:44 ` [PATCH 1/8] cleanup: get rid of ASSERT Dave Chinner
@ 2015-10-28 11:51   ` Brian Foster
  2015-10-28 22:32     ` Dave Chinner
  0 siblings, 1 reply; 17+ messages in thread
From: Brian Foster @ 2015-10-28 11:51 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Fri, Oct 16, 2015 at 12:44:54PM +1100, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> ASSERT comes from the xfs/xfs.h include, and we don't ever define
> DEBUG so we never get asserts built in. We want asserts built in for
> testing, but not for distro packages. The debian package already
> tries to do this by using "export DEBUG=-DNDEBUG" for the build
> context, but seeing as we pull in #define ASSERT(ex) (0) from the
> XFS headers it's a no-op.
> 
> Convert all the ASSERT calls to assert to remove this conflict with
> the xfsprogs headers and so local developer builds are built with
> asserts enabled.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---

My initial concern when reading this was that asserts were now
unconditionally enabled. According to the man page, assert() is enabled
unless NDEBUG is defined at include time. The debian builder apparently
does this, but is this standard for other such utils?

That aside, this seems like an inconsistent approach from our other
tools. For example, the debian/rules from xfsprogs does the same thing,
yet DEBUG must be defined to enable asserts in the first place. If the
problem is that asserts cannot be enabled, I'm wondering why the
appropriate fix isn't to define DEBUG somewhere for debug-enabled builds
rather than unconditionally convert all of the ASSERT() calls into
actual assert()'s..? We do actually have a bunch of '#ifdef DEBUG' code
throughout xfsdump (and DEBUG appears in 'configure' as well, though I
have no idea if that actually does anything)...

Brian

>  common/arch_xlate.c     |   1 +
>  common/cldmgr.c         |   3 +-
>  common/cleanup.c        |   7 +-
>  common/content_common.c |  13 +-
>  common/content_inode.h  |   4 +-
>  common/dlog.c           |  13 +-
>  common/drive.c          |  17 ++-
>  common/drive_minrmt.c   | 369 ++++++++++++++++++++++-----------------------
>  common/drive_scsitape.c | 389 ++++++++++++++++++++++++------------------------
>  common/drive_simple.c   | 151 +++++++++----------
>  common/fs.c             |  23 +--
>  common/global.c         |  13 +-
>  common/hsmapi.c         |   1 +
>  common/inventory.c      |  33 ++--
>  common/lock.c           |   3 +-
>  common/main.c           |  99 ++++++------
>  common/media.c          |  21 +--
>  common/mlog.c           |  21 +--
>  common/openutil.c       |   3 +-
>  common/path.c           |  25 ++--
>  common/qlock.c          |  29 ++--
>  common/ring.c           |  65 ++++----
>  common/stream.c         |  15 +-
>  common/util.c           |  41 ++---
>  dump/content.c          | 239 ++++++++++++++---------------
>  dump/inomap.c           |  19 +--
>  inventory/inv_api.c     |  33 ++--
>  inventory/inv_core.c    |   7 +-
>  inventory/inv_files.c   |   9 +-
>  inventory/inv_fstab.c   |   5 +-
>  inventory/inv_idx.c     |  11 +-
>  inventory/inv_mgr.c     |   7 +-
>  inventory/inv_oref.c    |  51 +++----
>  inventory/inv_oref.h    |  24 +--
>  inventory/inv_stobj.c   |  23 +--
>  inventory/testmain.c    |  25 ++--
>  librmt/rmtioctl.c       |   1 +
>  restore/bag.c           |  19 +--
>  restore/content.c       | 309 +++++++++++++++++++-------------------
>  restore/dirattr.c       | 113 +++++++-------
>  restore/inomap.c        |  25 ++--
>  restore/namreg.c        |  39 ++---
>  restore/node.c          |  79 +++++-----
>  restore/tree.c          | 219 +++++++++++++--------------
>  restore/win.c           |  65 ++++----
>  45 files changed, 1362 insertions(+), 1319 deletions(-)
> 
> diff --git a/common/arch_xlate.c b/common/arch_xlate.c
> index bafc1a6..e6f897e 100644
> --- a/common/arch_xlate.c
> +++ b/common/arch_xlate.c
> @@ -18,6 +18,7 @@
>  
>  #include <xfs/xfs.h>
>  #include <xfs/jdm.h>
> +#include <assert.h>
>  
>  #include "arch_xlate.h"
>  #include "types.h"
> diff --git a/common/cldmgr.c b/common/cldmgr.c
> index be7de34..df33a3f 100644
> --- a/common/cldmgr.c
> +++ b/common/cldmgr.c
> @@ -25,6 +25,7 @@
>  #include <sys/prctl.h>
>  #include <errno.h>
>  #include <pthread.h>
> +#include <assert.h>
>  
>  #include "exit.h"
>  #include "types.h"
> @@ -79,7 +80,7 @@ cldmgr_create( int ( * entry )( void *arg1 ),
>  	cld_t *cldp;
>  	intgen_t rval;
>  
> -	ASSERT( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
> +	assert( pthread_equal( pthread_self( ), cldmgr_parenttid ) );
>  
>  	cldp = cldmgr_getcld( );
>  	if ( ! cldp ) {
> diff --git a/common/cleanup.c b/common/cleanup.c
> index 42e8750..523f164 100644
> --- a/common/cleanup.c
> +++ b/common/cleanup.c
> @@ -17,6 +17,7 @@
>   */
>  
>  #include <stdlib.h>
> +#include <assert.h>
>  
>  #include "cleanup.h"
>  
> @@ -51,7 +52,7 @@ cleanup_register_base( void ( * funcp )( void *arg1, void *arg2 ),
>  	cu_t *p;
>  
>  	p = ( cu_t * )calloc( 1, sizeof( cu_t ));
> -	ASSERT( p );
> +	assert( p );
>  	p->cu_funcp = funcp;
>  	p->cu_arg1 = arg1;
>  	p->cu_arg2 = arg2;
> @@ -94,7 +95,7 @@ cleanup_cancel( cleanup_t *cleanupp )
>  	cu_t *nextp;
>  	cu_t *prevp;
>  
> -	ASSERT( cu_rootp );
> +	assert( cu_rootp );
>  
>  	for ( prevp = 0, nextp = cu_rootp
>  	      ;
> @@ -103,7 +104,7 @@ cleanup_cancel( cleanup_t *cleanupp )
>  	      prevp = nextp, nextp = nextp->cu_nextp )
>  	;
>  
> -	ASSERT( nextp );
> +	assert( nextp );
>  	if ( prevp ) {
>  		prevp->cu_nextp = p->cu_nextp;
>  	} else {
> diff --git a/common/content_common.c b/common/content_common.c
> index 993ddae..65be31f 100644
> --- a/common/content_common.c
> +++ b/common/content_common.c
> @@ -24,6 +24,7 @@
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <signal.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -66,7 +67,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* query: ask if media changed or declined
> @@ -77,13 +78,13 @@ retry:
>  		 (unsigned int)drivep->d_index );
>  	querycnt = 0;
>  	querystr[ querycnt++ ] = question;
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	dontix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("media change declined");
>  	doix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("media changed");
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	sigintix = IXMAX - 1;
>  
>  	responseix = dlog_multi_query( querystr,
> @@ -105,11 +106,11 @@ retry:
>  	} else if ( responseix == dontix ) {
>  		ackstr[ ackcnt++ ] = _("media change aborted\n");
>  	} else {
> -		ASSERT( responseix == sigintix );
> +		assert( responseix == sigintix );
>  		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
>  	}
>  
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_multi_ack( ackstr,
>  			ackcnt );
>  
> @@ -118,7 +119,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> diff --git a/common/content_inode.h b/common/content_inode.h
> index 8f0390c..9013ca4 100644
> --- a/common/content_inode.h
> +++ b/common/content_inode.h
> @@ -389,7 +389,7 @@ calc_checksum(void *bufp, size_t len)
>  	u_int32_t sum = 0;
>  	u_int32_t *sump = bufp;
>  	u_int32_t *endp = sump + len / sizeof(u_int32_t);
> -	ASSERT(len % sizeof(u_int32_t) == 0);
> +	assert(len % sizeof(u_int32_t) == 0);
>  	while (sump < endp)
>  		sum += *sump++;
>  	return ~sum + 1;
> @@ -401,7 +401,7 @@ is_checksum_valid(void *bufp, size_t len)
>  	u_int32_t sum = 0;
>  	u_int32_t *sump = bufp;
>  	u_int32_t *endp = sump + len / sizeof(u_int32_t);
> -	ASSERT(len % sizeof(u_int32_t) == 0);
> +	assert(len % sizeof(u_int32_t) == 0);
>  	while (sump < endp)
>  		sum += *sump++;
>  	return sum == 0 ? BOOL_TRUE : BOOL_FALSE;
> diff --git a/common/dlog.c b/common/dlog.c
> index ac0cafc..6220cfe 100644
> --- a/common/dlog.c
> +++ b/common/dlog.c
> @@ -26,6 +26,7 @@
>  #include <time.h>
>  #include <errno.h>
>  #include <signal.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -57,7 +58,7 @@ dlog_init( int argc, char *argv[ ] )
>  
>  	/* can only call once
>  	 */
> -	ASSERT( dlog_ttyfd == -1 );
> +	assert( dlog_ttyfd == -1 );
>  
>  	/* initially allow dialog, use stdin fd
>  	 */
> @@ -104,7 +105,7 @@ dlog_init( int argc, char *argv[ ] )
>  		struct stat statbuf;
>  		int rval;
>  
> -		ASSERT( dlog_ttyfd >= 0 );
> +		assert( dlog_ttyfd >= 0 );
>  		rval = fstat( dlog_ttyfd, &statbuf );
>  		if ( rval ) {
>  			mlog( MLOG_VERBOSE | MLOG_WARNING,
> @@ -186,7 +187,7 @@ dlog_multi_query( char *querystr[ ],
>  
>  	/* sanity
>  	 */
> -	ASSERT( dlog_allowed_flag );
> +	assert( dlog_allowed_flag );
>  
>  	/* display query description strings
>  	 */
> @@ -295,7 +296,7 @@ dlog_string_query( dlog_ucbp_t ucb, /* user's print func */
>  
>  	/* sanity
>  	 */
> -	ASSERT( dlog_allowed_flag );
> +	assert( dlog_allowed_flag );
>  
>  	/* call the caller's callback with his context, print context, and
>  	 * print operator
> @@ -359,7 +360,7 @@ dlog_string_query_print( void *ctxp, char *fmt, ... )
>  {
>  	va_list args;
>  
> -	ASSERT( ! ctxp );
> +	assert( ! ctxp );
>  
>  	va_start( args, fmt );
>  	mlog_va( MLOG_NORMAL | MLOG_NOLOCK | MLOG_BARE, fmt, args );
> @@ -510,7 +511,7 @@ promptinput( char *buf,
>  		}
>  		return BOOL_FALSE;
>  	} else {
> -		ASSERT( dlog_signo_received == -1 );
> +		assert( dlog_signo_received == -1 );
>  		*exceptionixp = 0;
>  		return BOOL_TRUE;
>  	}
> diff --git a/common/drive.c b/common/drive.c
> index 32a7191..f9ba851 100644
> --- a/common/drive.c
> +++ b/common/drive.c
> @@ -21,6 +21,7 @@
>  
>  #include <sys/stat.h>
>  #include <time.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -88,7 +89,7 @@ drive_init1( int argc, char *argv[ ] )
>  
>  	/* sanity check asserts
>  	 */
> -	ASSERT( sizeof( drive_hdr_t ) == DRIVE_HDR_SZ );
> +	assert( sizeof( drive_hdr_t ) == DRIVE_HDR_SZ );
>  
>  	/* count drive arguments
>  	 */
> @@ -107,7 +108,7 @@ drive_init1( int argc, char *argv[ ] )
>  	 */
>  	if (drivecnt > 0) {
>  		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
> -		ASSERT( drivepp );
> +		assert( drivepp );
>  	}
>  
>  	/* initialize the partialmax value.  Each drive can be completing a file
> @@ -142,7 +143,7 @@ drive_init1( int argc, char *argv[ ] )
>  			break;
>  		}
>  	}
> -	ASSERT( driveix == drivecnt );
> +	assert( driveix == drivecnt );
>  
>  	/* the user may specify stdin as the source, by
>  	 * a single dash ('-') with no option letter. This must appear
> @@ -169,7 +170,7 @@ drive_init1( int argc, char *argv[ ] )
>  		 * allocate an array to hold ptrs to drive descriptors
>  		 */
>  		drivepp = ( drive_t ** )calloc( drivecnt, sizeof( drive_t * ));
> -		ASSERT( drivepp );
> +		assert( drivepp );
>  
>  		drivepp[ 0 ] = drive_alloc( "stdio", 0 );
>  
> @@ -215,7 +216,7 @@ drive_init1( int argc, char *argv[ ] )
>  				bestscore = score;
>  			}
>  		}
> -		ASSERT( bestsp );
> +		assert( bestsp );
>  		drivep->d_strategyp = bestsp;
>  		drivep->d_recmarksep = bestsp->ds_recmarksep;
>  		drivep->d_recmfilesz = bestsp->ds_recmfilesz;
> @@ -356,7 +357,7 @@ drive_alloc( char *pathname, ix_t driveix )
>  	/* allocate the descriptor
>  	 */
>  	drivep = ( drive_t * )calloc( 1, sizeof( drive_t ));
> -	ASSERT( drivep );
> +	assert( drivep );
>  
>  	/* convert the pathname to an absolute pathname
>  	 * NOTE: string "stdio" is reserved to mean send to standard out
> @@ -397,7 +398,7 @@ drive_allochdrs( drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix )
>  	/* allocate the read header
>  	 */
>  	grhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
> -	ASSERT( grhdrp );
> +	assert( grhdrp );
>  	gwhdrp = NULL;
>  	dwhdrp = NULL;
>  
> @@ -411,7 +412,7 @@ drive_allochdrs( drive_t *drivep, global_hdr_t *gwhdrtemplatep, ix_t driveix )
>  		/* allocate the write header
>  		 */
>  		gwhdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
> -		ASSERT( gwhdrp );
> +		assert( gwhdrp );
>  
>  		/* copy the template
>  		 */
> diff --git a/common/drive_minrmt.c b/common/drive_minrmt.c
> index 8c57699..6d58f1f 100644
> --- a/common/drive_minrmt.c
> +++ b/common/drive_minrmt.c
> @@ -29,6 +29,7 @@
>  #include <sys/sysmacros.h>
>  #include <malloc.h>
>  #include <sched.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -471,11 +472,11 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  
>  	/* opportunity for sanity checking
>  	 */
> -	ASSERT( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
> -	ASSERT( sizeof( rec_hdr_t )
> +	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
> +	assert( sizeof( rec_hdr_t )
>  		==
>  		sizeofmember( drive_hdr_t, dh_specific ));
> -	ASSERT( ! ( STAPE_MAX_RECSZ % PGSZ ));
> +	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
>  
>  	/* hook up the drive ops
>  	 */
> @@ -484,7 +485,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  	/* allocate context for the drive manager
>  	 */
>  	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
> -	ASSERT( contextp );
> +	assert( contextp );
>  	memset( ( void * )contextp, 0, sizeof( *contextp ));
>  
>  	/* do not enable a separate I/O thread,
> @@ -583,7 +584,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  	 */
>  	if ( contextp->dc_singlethreadedpr ) {
>  		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
> -		ASSERT( contextp->dc_bufp );
> +		assert( contextp->dc_bufp );
>  	} else {
>  		intgen_t rval;
>  		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
> @@ -611,7 +612,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  				      _("not allowed "
>  				      "to pin down I/O buffer ring\n") );
>  			} else {
> -				ASSERT( 0 );
> +				assert( 0 );
>  			}
>  			return BOOL_FALSE;
>  		}
> @@ -721,18 +722,18 @@ do_begin_read( drive_t *drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( drivep->d_capabilities & DRIVE_CAP_READ );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( ! contextp->dc_recp );
> +	assert( drivep->d_capabilities & DRIVE_CAP_READ );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( ! contextp->dc_recp );
>  
>  	/* get a record buffer to use during initialization.
>  	 */
>  	if ( contextp->dc_singlethreadedpr ) {
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
> -		ASSERT( contextp->dc_ringp );
> +		assert( contextp->dc_ringp );
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  
> @@ -742,7 +743,7 @@ do_begin_read( drive_t *drivep )
>  	 */
>  	contextp->dc_iocnt = 0;
>  	if ( contextp->dc_fd < 0 ) {
> -		ASSERT( contextp->dc_fd == -1 );
> +		assert( contextp->dc_fd == -1 );
>  		rval = prepare_drive( drivep );
>  		if ( rval ) {
>  			if ( ! contextp->dc_singlethreadedpr ) {
> @@ -763,7 +764,7 @@ do_begin_read( drive_t *drivep )
>  			return rval;
>  		}
>  	}
> -	ASSERT( contextp->dc_iocnt == 1 );
> +	assert( contextp->dc_iocnt == 1 );
>  					/* set by prepare_drive or read_label */
>  
>  	/* all is well. adjust context. don't kick off read-aheads just yet;
> @@ -824,10 +825,10 @@ do_read( drive_t *drivep,
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( wantedcnt > 0 );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( wantedcnt > 0 );
>  
>  	/* clear the return status field
>  	 */
> @@ -853,7 +854,7 @@ do_read( drive_t *drivep,
>  	 */
>  	contextp->dc_ownedp = contextp->dc_nextp;
>  	contextp->dc_nextp += actualcnt;
> -	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> +	assert( contextp->dc_nextp <= contextp->dc_dataendp );
>  
>  	mlog( MLOG_NITTY | MLOG_DRIVE,
>  	      "rmt drive op read actual == %d (0x%x)\n",
> @@ -886,16 +887,16 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( contextp->dc_ownedp );
> -	ASSERT( bufp == contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( contextp->dc_ownedp );
> +	assert( bufp == contextp->dc_ownedp );
>  
>  	/* calculate how much the caller owns
>  	 */
> -	ASSERT( contextp->dc_nextp >= contextp->dc_ownedp );
> +	assert( contextp->dc_nextp >= contextp->dc_ownedp );
>  	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
> -	ASSERT( ownedcnt == retcnt );
> +	assert( ownedcnt == retcnt );
>  
>  	/* take possession of buffer portion
>  	 */
> @@ -905,7 +906,7 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
>  	 * and (if ring in use) give buffer to ring for read-ahead.
>  	 */
>  	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
> -		ASSERT( contextp->dc_nextp == contextp->dc_dataendp );
> +		assert( contextp->dc_nextp == contextp->dc_dataendp );
>  		if ( ! contextp->dc_singlethreadedpr ) {
>  			contextp->dc_msgp->rm_op = RING_OP_READ;
>  			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
> @@ -936,9 +937,9 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  	/* the mark is simply the offset into the media file of the
>  	 * next byte to be read.
> @@ -977,9 +978,9 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  
>  	/* the desired mark is passed by reference, and is really just an
> @@ -1002,18 +1003,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  #endif
>  
> -		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +		assert( contextp->dc_nextp >= contextp->dc_recp );
>  		recoff = ( u_int32_t )( contextp->dc_nextp
>  					-
>  					contextp->dc_recp );
> -		ASSERT( recoff <= tape_recsz );
> -		ASSERT( rechdrp->rec_used <= tape_recsz );
> -		ASSERT( recoff >= STAPE_HDR_SZ );
> -		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -		ASSERT( recoff <= rechdrp->rec_used );
> +		assert( recoff <= tape_recsz );
> +		assert( rechdrp->rec_used <= tape_recsz );
> +		assert( recoff >= STAPE_HDR_SZ );
> +		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +		assert( recoff <= rechdrp->rec_used );
>  		currentoffset += ( off64_t )recoff;
>  	}
> -	ASSERT( wantedoffset >= currentoffset );
> +	assert( wantedoffset >= currentoffset );
>  	
>  	/* if we are currently holding a record and the desired offset
>  	 * is not within the current record, eat the current record.
> @@ -1036,12 +1037,12 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			 * must be just after it.
>  			 */
>  			if ( rechdrp->rec_used < tape_recsz ) {
> -				ASSERT( wantedoffset == nextrecoffset );
> +				assert( wantedoffset == nextrecoffset );
>  			}
>  
>  			/* figure how much to ask for
>  			 */
> -			ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +			assert( contextp->dc_nextp >= contextp->dc_recp );
>  			recoff = ( u_int32_t )( contextp->dc_nextp
>  						-
>  						contextp->dc_recp );
> @@ -1059,13 +1060,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			if ( rval ) {
>  				return rval;
>  			}
> -			ASSERT( actualcnt == wantedcnt );
> +			assert( actualcnt == wantedcnt );
>  			do_return_read_buf( drivep, dummybufp, actualcnt );
>  			currentoffset += ( off64_t )actualcnt;
> -			ASSERT( currentoffset == nextrecoffset );
> -			ASSERT( wantedoffset >= currentoffset );
> -			ASSERT( ! contextp->dc_recp );
> -			ASSERT( currentoffset
> +			assert( currentoffset == nextrecoffset );
> +			assert( wantedoffset >= currentoffset );
> +			assert( ! contextp->dc_recp );
> +			assert( currentoffset
>  				==
>  				contextp->dc_reccnt * ( off64_t )tape_recsz );
>  		}
> @@ -1084,14 +1085,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		off64_t wantedreccnt;
>  		seekmode_t seekmode;
>  		
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
>  		if ( contextp->dc_singlethreadedpr ) {
>  			seekmode = SEEKMODE_RAW;
>  		} else {
>  			seekmode = SEEKMODE_BUF;
>  		}
> -		ASSERT( wantedreccnt != 0 ); /* so NOP below can be
> +		assert( wantedreccnt != 0 ); /* so NOP below can be
>  					      * distinguished from use
>  					      * in do_begin_read
>  					      */
> @@ -1101,7 +1102,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  			if ( seekmode == SEEKMODE_BUF ) {
>  				ring_stat_t rs;
> -				ASSERT( ! contextp->dc_msgp );
> +				assert( ! contextp->dc_msgp );
>  				contextp->dc_msgp =
>  						Ring_get( contextp->dc_ringp );
>  				rs = contextp->dc_msgp->rm_stat;
> @@ -1114,7 +1115,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				     rs != RING_STAT_INIT
>  				     &&
>  				     rs != RING_STAT_NOPACK ) {
> -					ASSERT( 0 );
> +					assert( 0 );
>  					contextp->dc_errorpr = BOOL_TRUE;
>  					return DRIVE_ERROR_CORE;
>  				}
> @@ -1136,8 +1137,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				continue;
>  			}
>  
> -			ASSERT( contextp->dc_reccnt == contextp->dc_iocnt );
> -			ASSERT( wantedreccnt > contextp->dc_reccnt );
> +			assert( contextp->dc_reccnt == contextp->dc_iocnt );
> +			assert( wantedreccnt > contextp->dc_reccnt );
>  			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
>  			recskipcnt64remaining = recskipcnt64;
>  			while ( recskipcnt64remaining ) {
> @@ -1145,14 +1146,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				intgen_t saved_errno;
>  				intgen_t rval;
>  
> -				ASSERT( recskipcnt64remaining > 0 );
> +				assert( recskipcnt64remaining > 0 );
>  				if ( recskipcnt64remaining > INTGENMAX ) {
>  					recskipcnt = INTGENMAX;
>  				} else {
>  					recskipcnt = ( intgen_t )
>  						     recskipcnt64remaining;
>  				}
> -				ASSERT( recskipcnt > 0 );
> +				assert( recskipcnt > 0 );
>  				rval = mt_op( contextp->dc_fd,
>  					      MTFSR,
>  					      recskipcnt );
> @@ -1174,8 +1175,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			currentoffset = contextp->dc_reccnt
>  					*
>  					( off64_t )tape_recsz;
> -			ASSERT( wantedoffset >= currentoffset );
> -			ASSERT( wantedoffset - currentoffset
> +			assert( wantedoffset >= currentoffset );
> +			assert( wantedoffset - currentoffset
>  				<
>  				( off64_t )tape_recsz );
>  		}
> @@ -1190,7 +1191,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		size_t actualcnt;
>  		intgen_t rval;
>  
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  
>  		/* figure how much to ask for. to eat an entire record,
>  		 * ask for a record sans the header. do_read will eat
> @@ -1205,11 +1206,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		if ( rval ) {
>  			return rval;
>  		}
> -		ASSERT( actualcnt == wantedcnt );
> +		assert( actualcnt == wantedcnt );
>  		do_return_read_buf( drivep, dummybufp, actualcnt );
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  		currentoffset += ( off64_t )tape_recsz;
> -		ASSERT( currentoffset
> +		assert( currentoffset
>  			==
>  			contextp->dc_reccnt * ( off64_t )tape_recsz );
>  	}
> @@ -1222,8 +1223,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		char *dummybufp;
>  		size_t actualcnt;
>  
> -		ASSERT( wantedoffset > currentoffset );
> -		ASSERT( wantedoffset - currentoffset < ( off64_t )tape_recsz );
> +		assert( wantedoffset > currentoffset );
> +		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
>  		wantedcnt = ( size_t )( wantedoffset - currentoffset );
>  		if ( contextp->dc_recp ) {
>  			u_int32_t recoff;
> @@ -1233,14 +1234,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			recoff = ( u_int32_t )( contextp->dc_nextp
>  						-
>  						contextp->dc_recp );
> -			ASSERT( recoff <= tape_recsz );
> -			ASSERT( rechdrp->rec_used <= tape_recsz );
> -			ASSERT( recoff >= STAPE_HDR_SZ );
> -			ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -			ASSERT( recoff <= rechdrp->rec_used );
> -			ASSERT( recoff + wantedcnt <= rechdrp->rec_used );
> +			assert( recoff <= tape_recsz );
> +			assert( rechdrp->rec_used <= tape_recsz );
> +			assert( recoff >= STAPE_HDR_SZ );
> +			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +			assert( recoff <= rechdrp->rec_used );
> +			assert( recoff + wantedcnt <= rechdrp->rec_used );
>  		} else {
> -			ASSERT( wantedcnt >= STAPE_HDR_SZ );
> +			assert( wantedcnt >= STAPE_HDR_SZ );
>  			wantedcnt -= STAPE_HDR_SZ;
>  		}
>  
> @@ -1253,7 +1254,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		    if ( rval ) {
>  			    return rval;
>  		    }
> -		    ASSERT( actualcnt == wantedcnt );
> +		    assert( actualcnt == wantedcnt );
>  		    do_return_read_buf( drivep, dummybufp, actualcnt );
>  		}
>  	}
> @@ -1268,18 +1269,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  #endif
>  
> -		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +		assert( contextp->dc_nextp >= contextp->dc_recp );
>  		recoff = ( u_int32_t )( contextp->dc_nextp
>  					-
>  					contextp->dc_recp );
> -		ASSERT( recoff <= tape_recsz );
> -		ASSERT( rechdrp->rec_used <= tape_recsz );
> -		ASSERT( recoff >= STAPE_HDR_SZ );
> -		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -		ASSERT( recoff <= rechdrp->rec_used );
> +		assert( recoff <= tape_recsz );
> +		assert( rechdrp->rec_used <= tape_recsz );
> +		assert( recoff >= STAPE_HDR_SZ );
> +		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +		assert( recoff <= rechdrp->rec_used );
>  		currentoffset += ( off64_t )recoff;
>  	}
> -	ASSERT( wantedoffset == currentoffset );
> +	assert( wantedoffset == currentoffset );
>  
>  	return 0;
>  }
> @@ -1310,9 +1311,9 @@ do_next_mark( drive_t *drivep )
>  
>  	/* assert protocol being followed.
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "rmt drive op: next mark\n" );
> @@ -1335,7 +1336,7 @@ noerrorsearch:
>  		}
>  		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  
> -		ASSERT( rechdrp->first_mark_offset != 0 );
> +		assert( rechdrp->first_mark_offset != 0 );
>  		if ( rechdrp->first_mark_offset > 0 ) {
>  			 off64_t markoff = rechdrp->first_mark_offset
>  					   -
> @@ -1343,8 +1344,8 @@ noerrorsearch:
>  			 off64_t curoff = ( off64_t )( contextp->dc_nextp
>  						       -
>  						       contextp->dc_recp );
> -			 ASSERT( markoff > 0 );
> -			 ASSERT( curoff > 0 );
> +			 assert( markoff > 0 );
> +			 assert( curoff > 0 );
>  			 if ( markoff >= curoff ) {
>  				break;
>  			}
> @@ -1359,7 +1360,7 @@ noerrorsearch:
>  		contextp->dc_reccnt++;
>  	}
>  
> -	ASSERT( rechdrp->first_mark_offset - rechdrp->file_offset
> +	assert( rechdrp->first_mark_offset - rechdrp->file_offset
>  		<=
>  		( off64_t )tape_recsz );
>  	contextp->dc_nextp = contextp->dc_recp
> @@ -1367,8 +1368,8 @@ noerrorsearch:
>  			     ( size_t )( rechdrp->first_mark_offset
>  					 -
>  					 rechdrp->file_offset );
> -	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> -	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> +	assert( contextp->dc_nextp <= contextp->dc_dataendp );
> +	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
>  	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
>  		if ( ! contextp->dc_singlethreadedpr ) {
>  			Ring_put( contextp->dc_ringp,
> @@ -1394,7 +1395,7 @@ resetring:
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
> @@ -1417,7 +1418,7 @@ validateread:
>  	}
>  
>  	if ( nread >= 0 ) {
> -		ASSERT( ( size_t )nread <= tape_recsz );
> +		assert( ( size_t )nread <= tape_recsz );
>  		mlog( MLOG_DEBUG | MLOG_DRIVE,
>  		      "short read (nread == %d, record size == %d)\n",
>  		      nread,
> @@ -1460,24 +1461,24 @@ validatehdr:
>  		goto readrecord;
>  	}
>  
> -	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
> +	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
>  	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
> -	ASSERT( markoff >= ( off64_t )STAPE_HDR_SZ );
> -	ASSERT( markoff < ( off64_t )tape_recsz );
> -	ASSERT( rechdrp->rec_used > STAPE_HDR_SZ );
> -	ASSERT( rechdrp->rec_used < tape_recsz );
> +	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
> +	assert( markoff < ( off64_t )tape_recsz );
> +	assert( rechdrp->rec_used > STAPE_HDR_SZ );
> +	assert( rechdrp->rec_used < tape_recsz );
>  
>  	goto alliswell;
>  
>  alliswell:
>  	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
> -	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
> +	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
>  	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
>  	contextp->dc_iocnt = contextp->dc_reccnt + 1;
>  	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
>  	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
> -	ASSERT( contextp->dc_dataendp <= contextp->dc_recendp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_dataendp );
> +	assert( contextp->dc_dataendp <= contextp->dc_recendp );
> +	assert( contextp->dc_nextp < contextp->dc_dataendp );
>  	contextp->dc_errorpr = BOOL_FALSE;
>  
>  	mlog( MLOG_NORMAL | MLOG_DRIVE,
> @@ -1553,8 +1554,8 @@ do_end_read( drive_t *drivep )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
>  
>  	/* In the scsi version, read_label() does a status command to the
>  	 * drive to then decide if doing a 'fsf' is appropriate.  For minrmt,
> @@ -1608,9 +1609,9 @@ do_begin_write( drive_t *drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( ! drivep->d_markrecheadp );
> -	ASSERT( ! contextp->dc_recp );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( ! drivep->d_markrecheadp );
> +	assert( ! contextp->dc_recp );
>  
>  	/* get pointers into global write header
>  	 */
> @@ -1621,7 +1622,7 @@ do_begin_write( drive_t *drivep )
>  	/* must already be open. The only way to open is to do a begin_read.
>  	 * so all interaction with tape requires reading first.
>  	 */
> -	ASSERT( contextp->dc_fd != -1 );
> +	assert( contextp->dc_fd != -1 );
>  
>  	/* fill in write header's drive specific info
>  	 */
> @@ -1637,15 +1638,15 @@ do_begin_write( drive_t *drivep )
>  	/* get a record buffer. will be used for the media file header,
>  	 * and is needed to "prime the pump" for first call to do_write.
>  	 */
> -	ASSERT( ! contextp->dc_recp );
> +	assert( ! contextp->dc_recp );
>  	if ( contextp->dc_singlethreadedpr ) {
> -		ASSERT( contextp->dc_bufp );
> +		assert( contextp->dc_bufp );
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
> -		ASSERT( contextp->dc_ringp );
> -		ASSERT( ! contextp->dc_msgp );
> +		assert( contextp->dc_ringp );
> +		assert( ! contextp->dc_msgp );
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  
> @@ -1690,7 +1691,7 @@ do_begin_write( drive_t *drivep )
>  	/* prepare the drive context. must have a record buffer ready to
>  	 * go, header initialized.
>  	 */
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( ! contextp->dc_ownedp );
>  	contextp->dc_reccnt = 1; /* count the header record */
>  	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
>  	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
> @@ -1735,15 +1736,15 @@ do_set_mark( drive_t *drivep,
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
>  
>  	/* calculate and fill in the mark record offset
>  	 */
> -	ASSERT( contextp->dc_recp );
> +	assert( contextp->dc_recp );
>  	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
>  		  +
>  		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
> @@ -1758,7 +1759,7 @@ do_set_mark( drive_t *drivep,
>  	 */
>  	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  	if ( rechdrp->first_mark_offset == -1LL ) {
> -		ASSERT( nextoff != -1LL );
> +		assert( nextoff != -1LL );
>  		rechdrp->first_mark_offset = nextoff;
>  	}
>  
> @@ -1771,7 +1772,7 @@ do_set_mark( drive_t *drivep,
>  		drivep->d_markrecheadp = markrecp;
>  		drivep->d_markrectailp = markrecp;
>  	} else {
> -		ASSERT( drivep->d_markrectailp );
> +		assert( drivep->d_markrectailp );
>  		drivep->d_markrectailp->dm_nextp = markrecp;
>  		drivep->d_markrectailp = markrecp;
>  	}
> @@ -1798,12 +1799,12 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* figure how much is available; supply the min of what is
>  	 * available and what is wanted.
> @@ -1864,17 +1865,17 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp <= contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp <= contextp->dc_recendp );
>  
>  	/* verify the caller is returning exactly what is held
>  	 */
> -	ASSERT( bufp == contextp->dc_ownedp );
> -	ASSERT( retcnt == heldcnt );
> +	assert( bufp == contextp->dc_ownedp );
> +	assert( retcnt == heldcnt );
>  
>  	/* take it back
>  	 */
> @@ -1915,7 +1916,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
>  			rval = contextp->dc_msgp->rm_rval;
>  			break;
>  		default:
> -			ASSERT( 0 );
> +			assert( 0 );
>  			return DRIVE_ERROR_CORE;
>  		}
>  	}
> @@ -1979,12 +1980,12 @@ do_get_align_cnt( drive_t * drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* calculate the next alignment point at or beyond the current nextp.
>  	 * the following algorithm works because all buffers are page-aligned
> @@ -1994,11 +1995,11 @@ do_get_align_cnt( drive_t * drivep )
>  	next_alignment_off +=  PGMASK;
>  	next_alignment_off &= ~PGMASK;
>  	next_alignment_point = ( char * )next_alignment_off;
> -	ASSERT( next_alignment_point <= contextp->dc_recendp );
> +	assert( next_alignment_point <= contextp->dc_recendp );
>  
>  	/* return the number of bytes to the next alignment offset
>  	 */
> -	ASSERT( next_alignment_point >= contextp->dc_nextp );
> +	assert( next_alignment_point >= contextp->dc_nextp );
>  	return ( size_t )( next_alignment_point - contextp->dc_nextp );
>  }
>  
> @@ -2025,12 +2026,12 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* pre-initialize return of count of bytes committed to media
>  	 */
> @@ -2072,7 +2073,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  					     contextp->dc_recp,
>  					     BOOL_TRUE, BOOL_TRUE );
>  		} else {
> -			ASSERT( contextp->dc_msgp );
> +			assert( contextp->dc_msgp );
>  			contextp->dc_msgp->rm_op = RING_OP_WRITE;
>  			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
>  			Ring_put( contextp->dc_ringp,
> @@ -2088,7 +2089,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  				rval = contextp->dc_msgp->rm_rval;
>  				break;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_recp = 0;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -2115,7 +2116,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  	}
>  	if ( ! contextp->dc_singlethreadedpr ) {
>  		while ( ! rval ) {
> -			ASSERT( contextp->dc_msgp );
> +			assert( contextp->dc_msgp );
>  			contextp->dc_msgp->rm_op = RING_OP_TRACE;
>  			Ring_put( contextp->dc_ringp,
>  				  contextp->dc_msgp );
> @@ -2127,14 +2128,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  			switch( contextp->dc_msgp->rm_stat ) {
>  			case RING_STAT_OK:
>  			case RING_STAT_INIT:
> -				ASSERT( rval == 0 );
> +				assert( rval == 0 );
>  				break;
>  			case RING_STAT_ERROR:
>  				rval = contextp->dc_msgp->rm_rval;
>  				first_rec_w_err = contextp->dc_msgp->rm_user;
>  				break;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_recp = 0;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -2182,11 +2183,11 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  	 * to tape.
>  	 */
>  	if ( rval ) {
> -		ASSERT( first_rec_w_err >= 0 );
> +		assert( first_rec_w_err >= 0 );
>  		recs_wtn_wo_err = first_rec_w_err;
>  		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
>  	} else {
> -		ASSERT( first_rec_w_err == -1 );
> +		assert( first_rec_w_err == -1 );
>  		recs_wtn_wo_err = contextp->dc_iocnt;
>  		recs_guaranteed = recs_wtn_wo_err;
>  	}
> @@ -2217,14 +2218,14 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "rmt drive op: fsf: count %d\n",
>  	      count );
>  
> -	ASSERT( count );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( count );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	for ( i = 0 ; i < count; i++ ) {
>  		done = 0;
> @@ -2243,7 +2244,7 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  			      _("advancing tape to next media file\n") );
>  
>  			op_failed = 0;
> -			ASSERT( contextp->dc_fd >= 0 );
> +			assert( contextp->dc_fd >= 0 );
>  			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
>  				op_failed = 1;
>  			}
> @@ -2294,14 +2295,14 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  	      "rmt drive op: bsf: count %d\n",
>  	      count );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	*statp = 0;
>  
>  	/* back space - places us to left of previous file mark
>  	 * if we hit BOT, return
>  	 */
> -	ASSERT( drivep->d_capabilities & DRIVE_CAP_BSF );
> +	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
>  	rval = bsf_and_verify( drivep );
>  	if (rval) {
>  		if (errno == ENOSPC/*IRIX*/ || errno == EIO/*Linux*/) {
> @@ -2379,8 +2380,8 @@ do_rewind( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "rmt drive op: rewind\n" );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* use validating tape rewind util func
>  	 */
> @@ -2405,8 +2406,8 @@ do_erase( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "rmt drive op: erase\n" );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* use validating tape rewind util func
>  	 */
> @@ -2443,8 +2444,8 @@ do_eject_media( drive_t *drivep )
>  
>  	/* drive must be open
>  	 */
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	/* issue tape unload
>  	 */
> @@ -2563,7 +2564,7 @@ read_label( drive_t *drivep )
>  	/* if a read error, get status
>  	 */
>  	if ( nread != ( intgen_t )tape_recsz ) {
> -		ASSERT( nread < ( intgen_t )tape_recsz );
> +		assert( nread < ( intgen_t )tape_recsz );
>  	} 
>  
>  	/* check for an unexpected errno
> @@ -2720,7 +2721,7 @@ get_tpcaps( drive_t *drivep )
>  #ifdef DEBUG
>  	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  #endif
>  
>  	/* can't ask about blksz, can't set blksz, can't ask about
> @@ -2796,7 +2797,7 @@ mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
>  	mop.mt_op   	= (short )sub_op;
>  	mop.mt_count	= param;
>  
> -	ASSERT( fd >= 0 );
> +	assert( fd >= 0 );
>  
>  	switch ( sub_op ) {
>  	case MTSEEK:
> @@ -3074,7 +3075,7 @@ prepare_drive( drive_t *drivep )
>  
>  	/* shouldn't be here if drive is open
>  	 */
> -	ASSERT( contextp->dc_fd == -1 );
> +	assert( contextp->dc_fd == -1 );
>  
>  	mlog( MLOG_VERBOSE | MLOG_DRIVE,
>  	      _("preparing drive\n") );
> @@ -3181,7 +3182,7 @@ prepare_drive( drive_t *drivep )
>  			      contextp->dc_recp,
>  			      tape_recsz,
>  			      &saved_errno );
> -		ASSERT( saved_errno == 0 || nread < 0 );
> +		assert( saved_errno == 0 || nread < 0 );
>  
>  		/* RMT can require a retry
>  		 */
> @@ -3340,7 +3341,7 @@ checkhdr:
>  			rec_hdr_t *tprhdrp;
>  			drhdrp = drivep->d_readhdrp;
>  			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
> -			ASSERT( tprhdrp->recsize >= 0 );
> +			assert( tprhdrp->recsize >= 0 );
>  			tape_recsz = ( size_t )tprhdrp->recsize;
>  			break;
>  		}
> @@ -3410,7 +3411,7 @@ Open( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: opening drive\n" );
>  
> -	ASSERT( contextp->dc_fd == -1 );
> +	assert( contextp->dc_fd == -1 );
>  
>  	errno = 0;
>  	contextp->dc_fd = open( drivep->d_pathname, oflags );
> @@ -3430,7 +3431,7 @@ Close( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: closing drive\n" );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	( void )close( contextp->dc_fd );
>  
> @@ -3447,8 +3448,8 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
>  	      "tape op: reading %u bytes\n",
>  	      cnt );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( bufp );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( bufp );
>  	*errnop = 0;
>  	errno = 0;
>  	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
> @@ -3483,8 +3484,8 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
>  	      "tape op: writing %u bytes\n",
>  	      cnt );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( bufp );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( bufp );
>  	*errnop = 0;
>  	errno = 0;
>  	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
> @@ -3664,7 +3665,7 @@ read_record(  drive_t *drivep, char *bufp )
>  	/* short read
>  	 */
>  	if ( nread >= 0 ) {
> -		ASSERT( nread <= ( intgen_t )tape_recsz );
> +		assert( nread <= ( intgen_t )tape_recsz );
>  		mlog( MLOG_DEBUG | MLOG_DRIVE,
>  		      "short read record %lld (nread == %d)\n",
>  		      contextp->dc_iocnt,
> @@ -3726,7 +3727,7 @@ getrec( drive_t *drivep )
>  				contextp->dc_errorpr = BOOL_TRUE;
>  				return contextp->dc_msgp->rm_rval;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_errorpr = BOOL_TRUE;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -3739,7 +3740,7 @@ getrec( drive_t *drivep )
>  		contextp->dc_nextp = contextp->dc_recp
>  				     +
>  				     STAPE_HDR_SZ;
> -		ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> +		assert( contextp->dc_nextp <= contextp->dc_dataendp );
>  	}
>  
>  	return 0;
> @@ -3775,7 +3776,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
>  	}
>  
>  	rval = determine_write_error( nwritten, saved_errno );
> -	ASSERT(rval);
> +	assert(rval);
>  
>  	return rval;
>  }
> @@ -3814,7 +3815,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
>  	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
>  	      "ring op: reset\n" );
>  	
> -	ASSERT( ringp );
> +	assert( ringp );
>  
>  	ring_reset( ringp, msgp );
>  }
> @@ -3845,14 +3846,14 @@ display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
>  	char *bufszsfxp;
>  	
>  	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
> -		ASSERT( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
> +		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
>  		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
> -		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
> +		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
>  		bufszsfxp = _("KB");
>  	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
> -		ASSERT( ! ( STAPE_MAX_RECSZ % 0x100000 ));
> +		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
>  		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
> -		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
> +		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
>  		bufszsfxp = _("MB");
>  	} else {
>  		sprintf( bufszbuf, "%u", (unsigned int)(tape_recsz / 0x400) );
> diff --git a/common/drive_scsitape.c b/common/drive_scsitape.c
> index 0abb5d0..3f45d01 100644
> --- a/common/drive_scsitape.c
> +++ b/common/drive_scsitape.c
> @@ -29,6 +29,7 @@
>  #include <sys/sysmacros.h>
>  #include <malloc.h>
>  #include <sched.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -551,11 +552,11 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  
>  	/* opportunity for sanity checking
>  	 */
> -	ASSERT( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
> -	ASSERT( sizeof( rec_hdr_t )
> +	assert( sizeof( global_hdr_t ) <= STAPE_HDR_SZ );
> +	assert( sizeof( rec_hdr_t )
>  		==
>  		sizeofmember( drive_hdr_t, dh_specific ));
> -	ASSERT( ! ( STAPE_MAX_RECSZ % PGSZ ));
> +	assert( ! ( STAPE_MAX_RECSZ % PGSZ ));
>  
>  	/* hook up the drive ops
>  	 */
> @@ -564,7 +565,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  	/* allocate context for the drive manager
>  	 */
>  	contextp = ( drive_context_t * )calloc( 1, sizeof( drive_context_t ));
> -	ASSERT( contextp );
> +	assert( contextp );
>  	memset( ( void * )contextp, 0, sizeof( *contextp ));
>  
>  	/* do not enable a separate I/O thread,
> @@ -673,7 +674,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  	 */
>  	if ( contextp->dc_singlethreadedpr ) {
>  		contextp->dc_bufp = ( char * )memalign( PGSZ, STAPE_MAX_RECSZ );
> -		ASSERT( contextp->dc_bufp );
> +		assert( contextp->dc_bufp );
>  	} else {
>  		intgen_t rval;
>  		mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
> @@ -701,7 +702,7 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  				      _("not allowed "
>  				      "to pin down I/O buffer ring\n") );
>  			} else {
> -				ASSERT( 0 );
> +				assert( 0 );
>  			}
>  			return BOOL_FALSE;
>  		}
> @@ -834,18 +835,18 @@ do_begin_read( drive_t *drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( drivep->d_capabilities & DRIVE_CAP_READ );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( ! contextp->dc_recp );
> +	assert( drivep->d_capabilities & DRIVE_CAP_READ );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( ! contextp->dc_recp );
>  
>  	/* get a record buffer to use during initialization.
>  	 */
>  	if ( contextp->dc_singlethreadedpr ) {
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
> -		ASSERT( contextp->dc_ringp );
> +		assert( contextp->dc_ringp );
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  
> @@ -855,7 +856,7 @@ do_begin_read( drive_t *drivep )
>  	 */
>  	contextp->dc_iocnt = 0;
>  	if ( contextp->dc_fd < 0 ) {
> -		ASSERT( contextp->dc_fd == -1 );
> +		assert( contextp->dc_fd == -1 );
>  		rval = prepare_drive( drivep );
>  		if ( rval ) {
>  			if ( ! contextp->dc_singlethreadedpr ) {
> @@ -876,7 +877,7 @@ do_begin_read( drive_t *drivep )
>  			return rval;
>  		}
>  	}
> -	ASSERT( contextp->dc_iocnt == 1 );
> +	assert( contextp->dc_iocnt == 1 );
>  					/* set by prepare_drive or read_label */
>  
>  	/* all is well. adjust context. don't kick off read-aheads just yet;
> @@ -937,10 +938,10 @@ do_read( drive_t *drivep,
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( wantedcnt > 0 );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( wantedcnt > 0 );
>  
>  	/* clear the return status field
>  	 */
> @@ -966,7 +967,7 @@ do_read( drive_t *drivep,
>  	 */
>  	contextp->dc_ownedp = contextp->dc_nextp;
>  	contextp->dc_nextp += actualcnt;
> -	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> +	assert( contextp->dc_nextp <= contextp->dc_dataendp );
>  
>  	mlog( MLOG_NITTY | MLOG_DRIVE,
>  	      "drive op read actual == %d (0x%x)\n",
> @@ -999,16 +1000,16 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( contextp->dc_ownedp );
> -	ASSERT( bufp == contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( contextp->dc_ownedp );
> +	assert( bufp == contextp->dc_ownedp );
>  
>  	/* calculate how much the caller owns
>  	 */
> -	ASSERT( contextp->dc_nextp >= contextp->dc_ownedp );
> +	assert( contextp->dc_nextp >= contextp->dc_ownedp );
>  	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
> -	ASSERT( ownedcnt == retcnt );
> +	assert( ownedcnt == retcnt );
>  
>  	/* take possession of buffer portion
>  	 */
> @@ -1018,7 +1019,7 @@ do_return_read_buf( drive_t *drivep, char *bufp, size_t retcnt )
>  	 * and (if ring in use) give buffer to ring for read-ahead.
>  	 */
>  	if ( contextp->dc_nextp >= contextp->dc_dataendp ) {
> -		ASSERT( contextp->dc_nextp == contextp->dc_dataendp );
> +		assert( contextp->dc_nextp == contextp->dc_dataendp );
>  		if ( ! contextp->dc_singlethreadedpr ) {
>  			contextp->dc_msgp->rm_op = RING_OP_READ;
>  			Ring_put( contextp->dc_ringp, contextp->dc_msgp );
> @@ -1049,9 +1050,9 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  	/* the mark is simply the offset into the media file of the
>  	 * next byte to be read.
> @@ -1090,9 +1091,9 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  
>  	/* the desired mark is passed by reference, and is really just an
> @@ -1115,18 +1116,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  #endif
>  
> -		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +		assert( contextp->dc_nextp >= contextp->dc_recp );
>  		recoff = ( u_int32_t )( contextp->dc_nextp
>  					-
>  					contextp->dc_recp );
> -		ASSERT( recoff <= tape_recsz );
> -		ASSERT( rechdrp->rec_used <= tape_recsz );
> -		ASSERT( recoff >= STAPE_HDR_SZ );
> -		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -		ASSERT( recoff <= rechdrp->rec_used );
> +		assert( recoff <= tape_recsz );
> +		assert( rechdrp->rec_used <= tape_recsz );
> +		assert( recoff >= STAPE_HDR_SZ );
> +		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +		assert( recoff <= rechdrp->rec_used );
>  		currentoffset += ( off64_t )recoff;
>  	}
> -	ASSERT( wantedoffset >= currentoffset );
> +	assert( wantedoffset >= currentoffset );
>  	
>  	/* if we are currently holding a record and the desired offset
>  	 * is not within the current record, eat the current record.
> @@ -1149,12 +1150,12 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			 * must be just after it.
>  			 */
>  			if ( rechdrp->rec_used < tape_recsz ) {
> -				ASSERT( wantedoffset == nextrecoffset );
> +				assert( wantedoffset == nextrecoffset );
>  			}
>  
>  			/* figure how much to ask for
>  			 */
> -			ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +			assert( contextp->dc_nextp >= contextp->dc_recp );
>  			recoff = ( u_int32_t )( contextp->dc_nextp
>  						-
>  						contextp->dc_recp );
> @@ -1172,13 +1173,13 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			if ( rval ) {
>  				return rval;
>  			}
> -			ASSERT( actualcnt == wantedcnt );
> +			assert( actualcnt == wantedcnt );
>  			do_return_read_buf( drivep, dummybufp, actualcnt );
>  			currentoffset += ( off64_t )actualcnt;
> -			ASSERT( currentoffset == nextrecoffset );
> -			ASSERT( wantedoffset >= currentoffset );
> -			ASSERT( ! contextp->dc_recp );
> -			ASSERT( currentoffset
> +			assert( currentoffset == nextrecoffset );
> +			assert( wantedoffset >= currentoffset );
> +			assert( ! contextp->dc_recp );
> +			assert( currentoffset
>  				==
>  				contextp->dc_reccnt * ( off64_t )tape_recsz );
>  		}
> @@ -1197,14 +1198,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		off64_t wantedreccnt;
>  		seekmode_t seekmode;
>  		
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  		wantedreccnt = wantedoffset / ( off64_t )tape_recsz;
>  		if ( contextp->dc_singlethreadedpr ) {
>  			seekmode = SEEKMODE_RAW;
>  		} else {
>  			seekmode = SEEKMODE_BUF;
>  		}
> -		ASSERT( wantedreccnt != 0 ); /* so NOP below can be
> +		assert( wantedreccnt != 0 ); /* so NOP below can be
>  					      * distinguished from use
>  					      * in do_begin_read
>  					      */
> @@ -1214,7 +1215,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  			if ( seekmode == SEEKMODE_BUF ) {
>  				ring_stat_t rs;
> -				ASSERT( ! contextp->dc_msgp );
> +				assert( ! contextp->dc_msgp );
>  				contextp->dc_msgp =
>  						Ring_get( contextp->dc_ringp );
>  				rs = contextp->dc_msgp->rm_stat;
> @@ -1227,7 +1228,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				     rs != RING_STAT_INIT
>  				     &&
>  				     rs != RING_STAT_NOPACK ) {
> -					ASSERT( 0 );
> +					assert( 0 );
>  					contextp->dc_errorpr = BOOL_TRUE;
>  					return DRIVE_ERROR_CORE;
>  				}
> @@ -1249,8 +1250,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				continue;
>  			}
>  
> -			ASSERT( contextp->dc_reccnt == contextp->dc_iocnt );
> -			ASSERT( wantedreccnt > contextp->dc_reccnt );
> +			assert( contextp->dc_reccnt == contextp->dc_iocnt );
> +			assert( wantedreccnt > contextp->dc_reccnt );
>  			recskipcnt64 = wantedreccnt - contextp->dc_reccnt;
>  			recskipcnt64remaining = recskipcnt64;
>  			while ( recskipcnt64remaining ) {
> @@ -1258,14 +1259,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  				intgen_t saved_errno;
>  				intgen_t rval;
>  
> -				ASSERT( recskipcnt64remaining > 0 );
> +				assert( recskipcnt64remaining > 0 );
>  				if ( recskipcnt64remaining > INTGENMAX ) {
>  					recskipcnt = INTGENMAX;
>  				} else {
>  					recskipcnt = ( intgen_t )
>  						     recskipcnt64remaining;
>  				}
> -				ASSERT( recskipcnt > 0 );
> +				assert( recskipcnt > 0 );
>  				rval = mt_op( contextp->dc_fd,
>  					      MTFSR,
>  					      recskipcnt );
> @@ -1287,8 +1288,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			currentoffset = contextp->dc_reccnt
>  					*
>  					( off64_t )tape_recsz;
> -			ASSERT( wantedoffset >= currentoffset );
> -			ASSERT( wantedoffset - currentoffset
> +			assert( wantedoffset >= currentoffset );
> +			assert( wantedoffset - currentoffset
>  				<
>  				( off64_t )tape_recsz );
>  		}
> @@ -1303,7 +1304,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		size_t actualcnt;
>  		intgen_t rval;
>  
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  
>  		/* figure how much to ask for. to eat an entire record,
>  		 * ask for a record sans the header. do_read will eat
> @@ -1318,11 +1319,11 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		if ( rval ) {
>  			return rval;
>  		}
> -		ASSERT( actualcnt == wantedcnt );
> +		assert( actualcnt == wantedcnt );
>  		do_return_read_buf( drivep, dummybufp, actualcnt );
> -		ASSERT( ! contextp->dc_recp );
> +		assert( ! contextp->dc_recp );
>  		currentoffset += ( off64_t )tape_recsz;
> -		ASSERT( currentoffset
> +		assert( currentoffset
>  			==
>  			contextp->dc_reccnt * ( off64_t )tape_recsz );
>  	}
> @@ -1335,8 +1336,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		char *dummybufp;
>  		size_t actualcnt;
>  
> -		ASSERT( wantedoffset > currentoffset );
> -		ASSERT( wantedoffset - currentoffset < ( off64_t )tape_recsz );
> +		assert( wantedoffset > currentoffset );
> +		assert( wantedoffset - currentoffset < ( off64_t )tape_recsz );
>  		wantedcnt = ( size_t )( wantedoffset - currentoffset );
>  		if ( contextp->dc_recp ) {
>  			u_int32_t recoff;
> @@ -1346,14 +1347,14 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  			recoff = ( u_int32_t )( contextp->dc_nextp
>  						-
>  						contextp->dc_recp );
> -			ASSERT( recoff <= tape_recsz );
> -			ASSERT( rechdrp->rec_used <= tape_recsz );
> -			ASSERT( recoff >= STAPE_HDR_SZ );
> -			ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -			ASSERT( recoff <= rechdrp->rec_used );
> -			ASSERT( recoff + wantedcnt <= rechdrp->rec_used );
> +			assert( recoff <= tape_recsz );
> +			assert( rechdrp->rec_used <= tape_recsz );
> +			assert( recoff >= STAPE_HDR_SZ );
> +			assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +			assert( recoff <= rechdrp->rec_used );
> +			assert( recoff + wantedcnt <= rechdrp->rec_used );
>  		} else {
> -			ASSERT( wantedcnt >= STAPE_HDR_SZ );
> +			assert( wantedcnt >= STAPE_HDR_SZ );
>  			wantedcnt -= STAPE_HDR_SZ;
>  		}
>  
> @@ -1366,7 +1367,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		    if ( rval ) {
>  			    return rval;
>  		    }
> -		    ASSERT( actualcnt == wantedcnt );
> +		    assert( actualcnt == wantedcnt );
>  		    do_return_read_buf( drivep, dummybufp, actualcnt );
>  		}
>  	}
> @@ -1381,18 +1382,18 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  		rec_hdr_t *rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  #endif
>  
> -		ASSERT( contextp->dc_nextp >= contextp->dc_recp );
> +		assert( contextp->dc_nextp >= contextp->dc_recp );
>  		recoff = ( u_int32_t )( contextp->dc_nextp
>  					-
>  					contextp->dc_recp );
> -		ASSERT( recoff <= tape_recsz );
> -		ASSERT( rechdrp->rec_used <= tape_recsz );
> -		ASSERT( recoff >= STAPE_HDR_SZ );
> -		ASSERT( rechdrp->rec_used >= STAPE_HDR_SZ );
> -		ASSERT( recoff <= rechdrp->rec_used );
> +		assert( recoff <= tape_recsz );
> +		assert( rechdrp->rec_used <= tape_recsz );
> +		assert( recoff >= STAPE_HDR_SZ );
> +		assert( rechdrp->rec_used >= STAPE_HDR_SZ );
> +		assert( recoff <= rechdrp->rec_used );
>  		currentoffset += ( off64_t )recoff;
>  	}
> -	ASSERT( wantedoffset == currentoffset );
> +	assert( wantedoffset == currentoffset );
>  
>  	return 0;
>  }
> @@ -1425,9 +1426,9 @@ do_next_mark( drive_t *drivep )
>  
>  	/* assert protocol being followed.
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
>  
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "drive op: next mark\n" );
> @@ -1450,7 +1451,7 @@ noerrorsearch:
>  		}
>  		rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  
> -		ASSERT( rechdrp->first_mark_offset != 0 );
> +		assert( rechdrp->first_mark_offset != 0 );
>  		if ( rechdrp->first_mark_offset > 0 ) {
>  			 off64_t markoff = rechdrp->first_mark_offset
>  					   -
> @@ -1458,8 +1459,8 @@ noerrorsearch:
>  			 off64_t curoff = ( off64_t )( contextp->dc_nextp
>  						       -
>  						       contextp->dc_recp );
> -			 ASSERT( markoff > 0 );
> -			 ASSERT( curoff > 0 );
> +			 assert( markoff > 0 );
> +			 assert( curoff > 0 );
>  			 if ( markoff >= curoff ) {
>  				break;
>  			}
> @@ -1474,7 +1475,7 @@ noerrorsearch:
>  		contextp->dc_reccnt++;
>  	}
>  
> -	ASSERT( rechdrp->first_mark_offset - rechdrp->file_offset
> +	assert( rechdrp->first_mark_offset - rechdrp->file_offset
>  		<=
>  		( off64_t )tape_recsz );
>  	contextp->dc_nextp = contextp->dc_recp
> @@ -1482,8 +1483,8 @@ noerrorsearch:
>  			     ( size_t )( rechdrp->first_mark_offset
>  					 -
>  					 rechdrp->file_offset );
> -	ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> -	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> +	assert( contextp->dc_nextp <= contextp->dc_dataendp );
> +	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
>  	if ( contextp->dc_nextp == contextp->dc_dataendp ) {
>  		if ( ! contextp->dc_singlethreadedpr ) {
>  			Ring_put( contextp->dc_ringp,
> @@ -1509,7 +1510,7 @@ resetring:
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
> @@ -1561,7 +1562,7 @@ validateread:
>  	}
>  
>  	if ( nread >= 0 ) {
> -		ASSERT( ( size_t )nread <= tape_recsz );
> +		assert( ( size_t )nread <= tape_recsz );
>  		mlog( MLOG_DEBUG | MLOG_DRIVE,
>  		      "short read (nread == %d, record size == %d)\n",
>  		      nread,
> @@ -1604,24 +1605,24 @@ validatehdr:
>  		goto readrecord;
>  	}
>  
> -	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
> +	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
>  	markoff = rechdrp->first_mark_offset - rechdrp->file_offset;
> -	ASSERT( markoff >= ( off64_t )STAPE_HDR_SZ );
> -	ASSERT( markoff < ( off64_t )tape_recsz );
> -	ASSERT( rechdrp->rec_used > STAPE_HDR_SZ );
> -	ASSERT( rechdrp->rec_used < tape_recsz );
> +	assert( markoff >= ( off64_t )STAPE_HDR_SZ );
> +	assert( markoff < ( off64_t )tape_recsz );
> +	assert( rechdrp->rec_used > STAPE_HDR_SZ );
> +	assert( rechdrp->rec_used < tape_recsz );
>  
>  	goto alliswell;
>  
>  alliswell:
>  	contextp->dc_nextp = contextp->dc_recp + ( size_t )markoff;
> -	ASSERT( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
> +	assert( ! ( rechdrp->file_offset % ( off64_t )tape_recsz ));
>  	contextp->dc_reccnt = rechdrp->file_offset / ( off64_t )tape_recsz;
>  	contextp->dc_iocnt = contextp->dc_reccnt + 1;
>  	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
>  	contextp->dc_dataendp = contextp->dc_recp + rechdrp->rec_used;
> -	ASSERT( contextp->dc_dataendp <= contextp->dc_recendp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_dataendp );
> +	assert( contextp->dc_dataendp <= contextp->dc_recendp );
> +	assert( contextp->dc_nextp < contextp->dc_dataendp );
>  	contextp->dc_errorpr = BOOL_FALSE;
>  
>  	mlog( MLOG_NORMAL | MLOG_DRIVE,
> @@ -1696,8 +1697,8 @@ do_end_read( drive_t *drivep )
>  
>  	/* assert protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
>  
>  	if ( ! contextp->dc_singlethreadedpr ) {
>  		Ring_reset( contextp->dc_ringp, contextp->dc_msgp );
> @@ -1745,9 +1746,9 @@ do_begin_write( drive_t *drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( ! drivep->d_markrecheadp );
> -	ASSERT( ! contextp->dc_recp );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( ! drivep->d_markrecheadp );
> +	assert( ! contextp->dc_recp );
>  
>  	/* get pointers into global write header
>  	 */
> @@ -1758,7 +1759,7 @@ do_begin_write( drive_t *drivep )
>  	/* must already be open. The only way to open is to do a begin_read.
>  	 * so all interaction with scsi tape requires reading first.
>  	 */
> -	ASSERT( contextp->dc_fd != -1 );
> +	assert( contextp->dc_fd != -1 );
>  
>  	/* get tape device status. verify tape is positioned
>   	 */
> @@ -1787,15 +1788,15 @@ do_begin_write( drive_t *drivep )
>  	/* get a record buffer. will be used for the media file header,
>  	 * and is needed to "prime the pump" for first call to do_write.
>  	 */
> -	ASSERT( ! contextp->dc_recp );
> +	assert( ! contextp->dc_recp );
>  	if ( contextp->dc_singlethreadedpr ) {
> -		ASSERT( contextp->dc_bufp );
> +		assert( contextp->dc_bufp );
>  		contextp->dc_recp = contextp->dc_bufp;
>  	} else {
> -		ASSERT( contextp->dc_ringp );
> -		ASSERT( ! contextp->dc_msgp );
> +		assert( contextp->dc_ringp );
> +		assert( ! contextp->dc_msgp );
>  		contextp->dc_msgp = Ring_get( contextp->dc_ringp );
> -		ASSERT( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
> +		assert( contextp->dc_msgp->rm_stat == RING_STAT_INIT );
>  		contextp->dc_recp = contextp->dc_msgp->rm_bufp;
>  	}
>  
> @@ -1840,7 +1841,7 @@ do_begin_write( drive_t *drivep )
>  	/* prepare the drive context. must have a record buffer ready to
>  	 * go, header initialized.
>  	 */
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( ! contextp->dc_ownedp );
>  	contextp->dc_reccnt = 1; /* count the header record */
>  	contextp->dc_recendp = contextp->dc_recp + tape_recsz;
>  	contextp->dc_nextp = contextp->dc_recp + STAPE_HDR_SZ;
> @@ -1885,15 +1886,15 @@ do_set_mark( drive_t *drivep,
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
>  
>  	/* calculate and fill in the mark record offset
>  	 */
> -	ASSERT( contextp->dc_recp );
> +	assert( contextp->dc_recp );
>  	nextoff = contextp->dc_reccnt * ( off64_t )tape_recsz
>  		  +
>  		  ( off64_t )( contextp->dc_nextp - contextp->dc_recp );
> @@ -1908,7 +1909,7 @@ do_set_mark( drive_t *drivep,
>  	 */
>  	rechdrp = ( rec_hdr_t * )contextp->dc_recp;
>  	if ( rechdrp->first_mark_offset == -1LL ) {
> -		ASSERT( nextoff != -1LL );
> +		assert( nextoff != -1LL );
>  		rechdrp->first_mark_offset = nextoff;
>  	}
>  
> @@ -1921,7 +1922,7 @@ do_set_mark( drive_t *drivep,
>  		drivep->d_markrecheadp = markrecp;
>  		drivep->d_markrectailp = markrecp;
>  	} else {
> -		ASSERT( drivep->d_markrectailp );
> +		assert( drivep->d_markrectailp );
>  		drivep->d_markrectailp->dm_nextp = markrecp;
>  		drivep->d_markrectailp = markrecp;
>  	}
> @@ -1948,12 +1949,12 @@ do_get_write_buf( drive_t *drivep, size_t wantedcnt, size_t *actualcntp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* figure how much is available; supply the min of what is
>  	 * available and what is wanted.
> @@ -2014,17 +2015,17 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp <= contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp <= contextp->dc_recendp );
>  
>  	/* verify the caller is returning exactly what is held
>  	 */
> -	ASSERT( bufp == contextp->dc_ownedp );
> -	ASSERT( retcnt == heldcnt );
> +	assert( bufp == contextp->dc_ownedp );
> +	assert( retcnt == heldcnt );
>  
>  	/* take it back
>  	 */
> @@ -2065,7 +2066,7 @@ do_write( drive_t *drivep, char *bufp, size_t retcnt )
>  			rval = contextp->dc_msgp->rm_rval;
>  			break;
>  		default:
> -			ASSERT( 0 );
> +			assert( 0 );
>  			return DRIVE_ERROR_CORE;
>  		}
>  	}
> @@ -2129,12 +2130,12 @@ do_get_align_cnt( drive_t * drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_errorpr );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_errorpr );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* calculate the next alignment point at or beyond the current nextp.
>  	 * the following algorithm works because all buffers are page-aligned
> @@ -2144,11 +2145,11 @@ do_get_align_cnt( drive_t * drivep )
>  	next_alignment_off +=  PGMASK;
>  	next_alignment_off &= ~PGMASK;
>  	next_alignment_point = ( char * )next_alignment_off;
> -	ASSERT( next_alignment_point <= contextp->dc_recendp );
> +	assert( next_alignment_point <= contextp->dc_recendp );
>  
>  	/* return the number of bytes to the next alignment offset
>  	 */
> -	ASSERT( next_alignment_point >= contextp->dc_nextp );
> +	assert( next_alignment_point >= contextp->dc_nextp );
>  	return ( size_t )( next_alignment_point - contextp->dc_nextp );
>  }
>  
> @@ -2175,12 +2176,12 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_recp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> -	ASSERT( contextp->dc_nextp < contextp->dc_recendp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_recp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp >= contextp->dc_recp + STAPE_HDR_SZ );
> +	assert( contextp->dc_nextp < contextp->dc_recendp );
>  
>  	/* pre-initialize return of count of bytes committed to media
>  	 */
> @@ -2222,7 +2223,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  					     contextp->dc_recp,
>  					     BOOL_TRUE, BOOL_TRUE );
>  		} else {
> -			ASSERT( contextp->dc_msgp );
> +			assert( contextp->dc_msgp );
>  			contextp->dc_msgp->rm_op = RING_OP_WRITE;
>  			contextp->dc_msgp->rm_user = contextp->dc_reccnt;
>  			Ring_put( contextp->dc_ringp,
> @@ -2238,7 +2239,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  				rval = contextp->dc_msgp->rm_rval;
>  				break;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_recp = 0;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -2265,7 +2266,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  	}
>  	if ( ! contextp->dc_singlethreadedpr ) {
>  		while ( ! rval ) {
> -			ASSERT( contextp->dc_msgp );
> +			assert( contextp->dc_msgp );
>  			contextp->dc_msgp->rm_op = RING_OP_TRACE;
>  			Ring_put( contextp->dc_ringp,
>  				  contextp->dc_msgp );
> @@ -2277,14 +2278,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  			switch( contextp->dc_msgp->rm_stat ) {
>  			case RING_STAT_OK:
>  			case RING_STAT_INIT:
> -				ASSERT( rval == 0 );
> +				assert( rval == 0 );
>  				break;
>  			case RING_STAT_ERROR:
>  				rval = contextp->dc_msgp->rm_rval;
>  				first_rec_w_err = contextp->dc_msgp->rm_user;
>  				break;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_recp = 0;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -2346,11 +2347,11 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  	 * to tape.
>  	 */
>  	if ( rval ) {
> -		ASSERT( first_rec_w_err >= 0 );
> +		assert( first_rec_w_err >= 0 );
>  		recs_wtn_wo_err = first_rec_w_err;
>  		recs_guaranteed = recs_wtn_wo_err - contextp->dc_lostrecmax;
>  	} else {
> -		ASSERT( first_rec_w_err == -1 );
> +		assert( first_rec_w_err == -1 );
>  		recs_wtn_wo_err = contextp->dc_iocnt;
>  		recs_guaranteed = recs_wtn_wo_err;
>  	}
> @@ -2382,14 +2383,14 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "drive op: fsf: count %d\n",
>  	      count );
>  
> -	ASSERT( count );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( count );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	/* get tape status
>    	 */
> @@ -2426,7 +2427,7 @@ do_fsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  			      _("advancing tape to next media file\n") );
>  
>  			op_failed = 0;
> -			ASSERT( contextp->dc_fd >= 0 );
> +			assert( contextp->dc_fd >= 0 );
>  			if ( mt_op( contextp->dc_fd, MTFSF, 1 ) ) {
>  				op_failed = 1;
>  			}
> @@ -2482,7 +2483,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  	      "drive op: bsf: count %d\n",
>  	      count );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	*statp = 0;
>  
> @@ -2515,7 +2516,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  			*statp = DRIVE_ERROR_DEVICE;
>  			return 0;
>  		}
> -		ASSERT( IS_BOT(mtstat ));
> +		assert( IS_BOT(mtstat ));
>  
>  
>  		*statp = DRIVE_ERROR_BOM;
> @@ -2531,7 +2532,7 @@ do_bsf( drive_t *drivep, intgen_t count, intgen_t *statp )
>  
>  	/* back space - places us to left of previous file mark
>  	 */
> -	ASSERT( drivep->d_capabilities & DRIVE_CAP_BSF );
> +	assert( drivep->d_capabilities & DRIVE_CAP_BSF );
>  	mtstat = bsf_and_verify( drivep );
>  
>  	/* check again for beginning-of-tape condition
> @@ -2606,8 +2607,8 @@ do_rewind( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "drive op: rewind\n" );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* use validating tape rewind util func
>  	 */
> @@ -2637,8 +2638,8 @@ do_erase( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "drive op: erase\n" );
>  
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* use validating tape rewind util func
>  	 */
> @@ -2681,8 +2682,8 @@ do_eject_media( drive_t *drivep )
>  
>  	/* drive must be open
>  	 */
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	/* issue tape unload
>  	 */
> @@ -2913,7 +2914,7 @@ read_label( drive_t *drivep )
>  	/* if a read error, get status
>  	 */
>  	if ( nread != ( intgen_t )tape_recsz ) {
> -		ASSERT( nread < ( intgen_t )tape_recsz );
> +		assert( nread < ( intgen_t )tape_recsz );
>  		ok = mt_get_status( drivep, &mtstat );
>  		if ( ! ok ) {
>  			status_failed_message( drivep );
> @@ -3135,10 +3136,10 @@ set_fixed_blksz( drive_t *drivep, size_t blksz )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( blksz );
> -	ASSERT( contextp->dc_isvarpr == BOOL_FALSE );
> -	ASSERT( contextp->dc_cansetblkszpr );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( blksz );
> +	assert( contextp->dc_isvarpr == BOOL_FALSE );
> +	assert( contextp->dc_cansetblkszpr );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* give it two tries: first without rewinding, second with rewinding
>  	 */
> @@ -3213,7 +3214,7 @@ get_tpcaps( drive_t *drivep )
>  {
>  	drive_context_t	*contextp = ( drive_context_t * )drivep->d_contextp;
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	if ( contextp->dc_isrmtpr ) {
>  		/* can't ask about blksz, can't set blksz, can't ask about
> @@ -3386,7 +3387,7 @@ mt_op(intgen_t fd, intgen_t sub_op, intgen_t param )
>  	mop.mt_op   	= (short )sub_op;
>  	mop.mt_count	= param;
>  
> -	ASSERT( fd >= 0 );
> +	assert( fd >= 0 );
>  
>  	switch ( sub_op ) {
>  	case MTSEEK:
> @@ -3458,7 +3459,7 @@ mt_get_fileno( drive_t *drivep, long *fileno)
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: get fileno\n" );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	if ( ioctl(contextp->dc_fd, MTIOCGET, &mt_stat) < 0 ) {
>  		/* failure
> @@ -3491,7 +3492,7 @@ mt_get_status( drive_t *drivep, long *status)
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: get status\n" );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	if (TS_ISDRIVER) {
>  		/*
> @@ -3864,7 +3865,7 @@ retry:
>  
>  	/* shouldn't be here if drive is open
>  	 */
> -	ASSERT( contextp->dc_fd == -1 );
> +	assert( contextp->dc_fd == -1 );
>  
>  	mlog( MLOG_VERBOSE | MLOG_DRIVE,
>  	      _("preparing drive\n") );
> @@ -3966,7 +3967,7 @@ retry:
>  
>  		Close( drivep );
>  	}
> -	ASSERT( IS_ONL( mtstat ));
> +	assert( IS_ONL( mtstat ));
>  
>  	/* determine tape capabilities. this will set the drivep->d_capabilities
>  	 * and contextp->dc_{...}blksz and dc_isQICpr, as well as recommended
> @@ -4156,7 +4157,7 @@ retry:
>  			      contextp->dc_recp,
>  			      tape_recsz,
>  			      &saved_errno );
> -		ASSERT( saved_errno == 0 || nread < 0 );
> +		assert( saved_errno == 0 || nread < 0 );
>  
>  		/* RMT can require a retry
>  		 */
> @@ -4536,7 +4537,7 @@ checkhdr:
>  			rec_hdr_t *tprhdrp;
>  			drhdrp = drivep->d_readhdrp;
>  			tprhdrp = ( rec_hdr_t * )drhdrp->dh_specific;
> -			ASSERT( tprhdrp->recsize >= 0 );
> +			assert( tprhdrp->recsize >= 0 );
>  			tape_recsz = ( size_t )tprhdrp->recsize;
>  			mlog( MLOG_DEBUG | MLOG_DRIVE,
>  			      "tape record size set to header's "
> @@ -4657,7 +4658,7 @@ Open( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: opening drive\n" );
>  
> -	ASSERT( contextp->dc_fd == -1 );
> +	assert( contextp->dc_fd == -1 );
>  
>  	errno = 0;
>  	contextp->dc_fd = open( drivep->d_pathname, oflags );
> @@ -4678,7 +4679,7 @@ Close( drive_t *drivep )
>  	mlog( MLOG_DEBUG | MLOG_DRIVE,
>  	      "tape op: closing drive\n" );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	( void )close( contextp->dc_fd );
>  
> @@ -4695,8 +4696,8 @@ Read( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
>  	      "tape op: reading %u bytes\n",
>  	      cnt );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( bufp );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( bufp );
>  	*errnop = 0;
>  	errno = 0;
>  	nread = read( contextp->dc_fd, ( void * )bufp, cnt );
> @@ -4731,8 +4732,8 @@ Write( drive_t *drivep, char *bufp, size_t cnt, intgen_t *errnop )
>  	      "tape op: writing %u bytes\n",
>  	      cnt );
>  
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( bufp );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( bufp );
>  	*errnop = 0;
>  	errno = 0;
>  	nwritten = write( contextp->dc_fd, ( void * )bufp, cnt );
> @@ -4944,7 +4945,7 @@ read_record(  drive_t *drivep, char *bufp )
>  	/* short read
>  	 */
>  	if ( nread >= 0 ) {
> -		ASSERT( nread <= ( intgen_t )tape_recsz );
> +		assert( nread <= ( intgen_t )tape_recsz );
>  		mlog( MLOG_DEBUG | MLOG_DRIVE,
>  		      "short read record %lld (nread == %d)\n",
>  		      contextp->dc_iocnt,
> @@ -5006,7 +5007,7 @@ getrec( drive_t *drivep )
>  				contextp->dc_errorpr = BOOL_TRUE;
>  				return contextp->dc_msgp->rm_rval;
>  			default:
> -				ASSERT( 0 );
> +				assert( 0 );
>  				contextp->dc_errorpr = BOOL_TRUE;
>  				return DRIVE_ERROR_CORE;
>  			}
> @@ -5019,7 +5020,7 @@ getrec( drive_t *drivep )
>  		contextp->dc_nextp = contextp->dc_recp
>  				     +
>  				     STAPE_HDR_SZ;
> -		ASSERT( contextp->dc_nextp <= contextp->dc_dataendp );
> +		assert( contextp->dc_nextp <= contextp->dc_dataendp );
>  	}
>  
>  	return 0;
> @@ -5055,7 +5056,7 @@ write_record(  drive_t *drivep, char *bufp, bool_t chksumpr, bool_t xlatepr )
>  	}
>  
>  	rval = determine_write_error( drivep, nwritten, saved_errno );
> -	ASSERT( rval );
> +	assert( rval );
>  
>  	return rval;
>  }
> @@ -5094,7 +5095,7 @@ Ring_reset(  ring_t *ringp, ring_msg_t *msgp )
>  	mlog( (MLOG_NITTY + 1) | MLOG_DRIVE,
>  	      "ring op: reset\n" );
>  	
> -	ASSERT( ringp );
> +	assert( ringp );
>  
>  	ring_reset( ringp, msgp );
>  }
> @@ -5125,19 +5126,19 @@ display_ring_metrics( drive_t *drivep, intgen_t mlog_flags )
>  	char *bufszsfxp;
>  	
>  	if ( tape_recsz == STAPE_MIN_MAX_BLKSZ ) {
> -		ASSERT( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
> +		assert( ! ( STAPE_MIN_MAX_BLKSZ % 0x400 ));
>  		sprintf( bufszbuf, "%u", STAPE_MIN_MAX_BLKSZ / 0x400 );
> -		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
> +		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
>  		bufszsfxp = "KB";
>  	} else if ( tape_recsz == STAPE_MAX_RECSZ ) {
> -		ASSERT( ! ( STAPE_MAX_RECSZ % 0x100000 ));
> +		assert( ! ( STAPE_MAX_RECSZ % 0x100000 ));
>  		sprintf( bufszbuf, "%u", STAPE_MAX_RECSZ / 0x100000 );
> -		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
> +		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
>  		bufszsfxp = "MB";
>  	} else if ( tape_recsz == STAPE_MAX_LINUX_RECSZ ) {
> -		ASSERT( ! ( STAPE_MAX_LINUX_RECSZ % 0x100000 ));
> +		assert( ! ( STAPE_MAX_LINUX_RECSZ % 0x100000 ));
>  		sprintf( bufszbuf, "%u", STAPE_MAX_LINUX_RECSZ / 0x100000 );
> -		ASSERT( strlen( bufszbuf ) < sizeof( bufszbuf ));
> +		assert( strlen( bufszbuf ) < sizeof( bufszbuf ));
>  		bufszsfxp = "MB";
>  	} else {
>  		bufszsfxp = "";
> diff --git a/common/drive_simple.c b/common/drive_simple.c
> index 2b0447d..2e57d8c 100644
> --- a/common/drive_simple.c
> +++ b/common/drive_simple.c
> @@ -25,6 +25,7 @@
>  #include <errno.h>
>  #include <malloc.h>
>  #include <sched.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -185,7 +186,7 @@ ds_match( int argc, char *argv[], drive_t *drivep )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
> +	assert( ! ( sizeofmember( drive_context_t, dc_buf ) % PGSZ ));
>  
>  	/* determine if this is an rmt file. if so, give a weak match:
>  	 * might be an ordinary file accessed via the rmt protocol.
> @@ -234,8 +235,8 @@ ds_instantiate( int argc, char *argv[], drive_t *drivep )
>  	 */
>  	contextp = ( drive_context_t * )memalign( PGSZ,
>  						  sizeof( drive_context_t ));
> -	ASSERT( contextp );
> -	ASSERT( ( void * )contextp->dc_buf == ( void * )contextp );
> +	assert( contextp );
> +	assert( ( void * )contextp->dc_buf == ( void * )contextp );
>  	memset( ( void * )contextp, 0, sizeof( *contextp ));
>  
>  	/* scan drive device pathname to see if remote tape
> @@ -439,9 +440,9 @@ do_begin_read( drive_t *drivep )
>  
>  	/* verify protocol being followed
>  	 */
> -	ASSERT( dcaps & DRIVE_CAP_READ );
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( dcaps & DRIVE_CAP_READ );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	/* can only read one media file
>  	 */
> @@ -484,7 +485,7 @@ do_begin_read( drive_t *drivep )
>  		free(tmphdr);
>  		return rval;
>  	}
> -	ASSERT( ( size_t )nread == GLOBAL_HDR_SZ );
> +	assert( ( size_t )nread == GLOBAL_HDR_SZ );
>  	
>  	mlog(MLOG_NITTY, "do_begin_read: global_hdr\n"
>  	     "\tgh_magic %.100s\n"
> @@ -585,9 +586,9 @@ do_read( drive_t *drivep,
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( wantedcnt > 0 );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
> +	assert( wantedcnt > 0 );
>  
>  	/* pre-initialize reference return
>  	 */
> @@ -595,7 +596,7 @@ do_read( drive_t *drivep,
>  
>  	/* count number of unread bytes in buffer
>  	 */
> -	ASSERT( contextp->dc_emptyp >= contextp->dc_nextp );
> +	assert( contextp->dc_emptyp >= contextp->dc_nextp );
>  	remainingcnt = ( size_t )( contextp->dc_emptyp - contextp->dc_nextp );
>  
>  	/* if no unread bytes in buffer, refill
> @@ -628,7 +629,7 @@ do_read( drive_t *drivep,
>  		/* record the ptrs to the first empty byte and the next
>  		 * byte to be read
>  		 */
> -		ASSERT( nread <= BUFSZ );
> +		assert( nread <= BUFSZ );
>  		contextp->dc_emptyp = contextp->dc_buf + nread;
>  		contextp->dc_nextp = contextp->dc_buf;
>  
> @@ -656,7 +657,7 @@ do_read( drive_t *drivep,
>  	/* advance the next ptr to the next byte to be supplied
>  	 */
>  	contextp->dc_nextp += actualcnt;
> -	ASSERT( contextp->dc_nextp <= contextp->dc_emptyp );
> +	assert( contextp->dc_nextp <= contextp->dc_emptyp );
>  
>  	/* return the actual number of bytes supplied, and a ptr to the first
>  	 */
> @@ -681,17 +682,17 @@ do_return_read_buf( drive_t *drivep, char *retp, size_t retcnt )
>  
>  	/* verify protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( contextp->dc_ownedp );
>  
>  	/* verify returning right buffer
>  	 */
> -	ASSERT( retp == contextp->dc_ownedp );
> +	assert( retp == contextp->dc_ownedp );
>  
>  	/* verify all of buffer provided is being returned
>  	 */
>  	ownedcnt = ( size_t )( contextp->dc_nextp - contextp->dc_ownedp );
> -	ASSERT( retcnt == ownedcnt );
> +	assert( retcnt == ownedcnt );
>  
>  	/* indicate nothing now owned by caller
>  	 */
> @@ -713,8 +714,8 @@ do_get_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
>  
>  	/* calculate the offset of the next byte to be supplied relative to
>  	 * the beginning of the buffer and relative to the beginning of
> @@ -746,8 +747,8 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
>  
>  	/* calculate the current offset within the media file
>  	 * of the next byte to be read
> @@ -784,7 +785,7 @@ do_seek_mark( drive_t *drivep, drive_mark_t *markp )
>  	 */
>  	nextoff = ( off64_t )( contextp->dc_nextp - contextp->dc_buf );
>  	strmoff = contextp->dc_bufstroff + nextoff;
> -	ASSERT( strmoff == mark );
> +	assert( strmoff == mark );
>  
>  	return 0;
>  }
> @@ -808,9 +809,9 @@ do_next_mark( drive_t *drivep )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( dcaps & DRIVE_CAP_NEXTMARK );
> -	ASSERT( contextp->dc_mode == OM_READ );
> -	ASSERT( ! contextp->dc_ownedp );
> +	assert( dcaps & DRIVE_CAP_NEXTMARK );
> +	assert( contextp->dc_mode == OM_READ );
> +	assert( ! contextp->dc_ownedp );
>  
>  	if ( ! mark ) {
>  		return DRIVE_ERROR_EOF;
> @@ -837,13 +838,13 @@ do_end_read( drive_t *drivep )
>  
>  	/* be sure we are following protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_READ );
> +	assert( contextp->dc_mode == OM_READ );
>  	contextp->dc_mode = OM_NONE;
>  
>  	/* bump the file mark cnt
>  	 */
>  	contextp->dc_fmarkcnt++;
> -	ASSERT( contextp->dc_fmarkcnt == 1 );
> +	assert( contextp->dc_fmarkcnt == 1 );
>  }
>  
>  /* begin_write - prepare file for writing
> @@ -871,12 +872,12 @@ do_begin_write( drive_t *drivep )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
> +	assert( dwhdrp->dh_strategyid == DRIVE_STRATEGY_SIMPLE );
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_fd >= 0 );
> -	ASSERT( contextp->dc_mode == OM_NONE );
> +	assert( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
>  
>  	/* only one media file may be written
>  	 */
> @@ -918,7 +919,7 @@ do_begin_write( drive_t *drivep )
>  	contextp->dc_mode = OM_WRITE;
>  
>  	tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
> -	ASSERT(tmphdr);
> +	assert(tmphdr);
>  	memset(tmphdr, 0, GLOBAL_HDR_SZ);
>  	tmpdh = (drive_hdr_t *)tmphdr->gh_upper;
>  	tmpmh = (media_hdr_t *)tmpdh->dh_upper;
> @@ -997,9 +998,9 @@ do_set_mark( drive_t *drivep,
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_nextp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_nextp );
>  
>  	/* calculate the mark offset
>  	 */
> @@ -1053,7 +1054,7 @@ do_set_mark( drive_t *drivep,
>  
>  			/* assert the header has been flushed
>  			 */
> -			ASSERT( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
> +			assert( contextp->dc_bufstroff >= sizeof( *gwhdrp ));
>  
>  			/* record mark in hdr
>  			 */
> @@ -1082,7 +1083,7 @@ do_set_mark( drive_t *drivep,
>  				content_hdr_t		*ch = (content_hdr_t *)mh->mh_upper;
>  				content_inode_hdr_t	*cih = (content_inode_hdr_t *)ch->ch_specific;
>  
> -				ASSERT( newoff == 0 );
> +				assert( newoff == 0 );
>  
>  				/* write and seek back to current offset
>  				 */
> @@ -1092,7 +1093,7 @@ do_set_mark( drive_t *drivep,
>  				     "(on media)\n" );
>  
>  				tmphdr = (global_hdr_t *)malloc(GLOBAL_HDR_SZ);
> -				ASSERT(tmphdr);
> +				assert(tmphdr);
>  				tmpdh = (drive_hdr_t *)tmphdr->gh_upper;
>  				tmpmh = (media_hdr_t *)tmpdh->dh_upper;
>  				tmpch = (content_hdr_t *)tmpmh->mh_upper;
> @@ -1129,13 +1130,13 @@ do_set_mark( drive_t *drivep,
>  				nwritten = write( contextp->dc_fd,
>  						  tmphdr,
>  						  sizeof( *tmphdr ));
> -				ASSERT( ( size_t )nwritten == sizeof( *tmphdr ));
> +				assert( ( size_t )nwritten == sizeof( *tmphdr ));
>  				free(tmphdr);
>  
>  				newoff = lseek64( contextp->dc_fd,
>  						  contextp->dc_bufstroff,
>  						  SEEK_SET );
> -				ASSERT( newoff == contextp->dc_bufstroff );
> +				assert( newoff == contextp->dc_bufstroff );
>  			}
>  		}
>  	}
> @@ -1144,7 +1145,7 @@ do_set_mark( drive_t *drivep,
>  	 * otherwise put the mark record on the tail of the queue.
>  	 */
>  	if ( contextp->dc_nextp == contextp->dc_buf ) {
> -		ASSERT( drivep->d_markrecheadp == 0 );
> +		assert( drivep->d_markrecheadp == 0 );
>  		( * cbfuncp )( cbcontextp, markrecp, BOOL_TRUE );
>  		return;
>  	} else {
> @@ -1155,7 +1156,7 @@ do_set_mark( drive_t *drivep,
>  			drivep->d_markrecheadp = markrecp;
>  			drivep->d_markrectailp = markrecp;
>  		} else {
> -			ASSERT( drivep->d_markrectailp );
> +			assert( drivep->d_markrectailp );
>  			drivep->d_markrectailp->dm_nextp = markrecp;
>  			drivep->d_markrectailp = markrecp;
>  		}
> @@ -1180,11 +1181,11 @@ do_get_write_buf( drive_t *drivep, size_t wanted_bufsz, size_t *actual_bufszp )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
> -	ASSERT( contextp->dc_ownedsz == 0 );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_emptyp );
> +	assert( contextp->dc_ownedsz == 0 );
>  
>  	/* calculate how much buffer remains
>  	 */
> @@ -1237,18 +1238,18 @@ do_write( drive_t *drivep, char *bufp, size_t writesz )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( contextp->dc_ownedp );
> -	ASSERT( bufp == contextp->dc_ownedp );
> -	ASSERT( ! contextp->dc_nextp );
> -	ASSERT( contextp->dc_ownedp < contextp->dc_emptyp );
> -	ASSERT( writesz == contextp->dc_ownedsz );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( contextp->dc_ownedp );
> +	assert( bufp == contextp->dc_ownedp );
> +	assert( ! contextp->dc_nextp );
> +	assert( contextp->dc_ownedp < contextp->dc_emptyp );
> +	assert( writesz == contextp->dc_ownedsz );
>  
>  	/* calculate next portion of buffer available for get_write_buf,
>  	 * and indicate no portion is owned.
>  	 */
>  	contextp->dc_nextp = contextp->dc_ownedp + writesz;
> -	ASSERT( contextp->dc_nextp <= contextp->dc_emptyp );
> +	assert( contextp->dc_nextp <= contextp->dc_emptyp );
>  	contextp->dc_ownedp = 0;
>  	contextp->dc_ownedsz = 0;
>  
> @@ -1304,10 +1305,10 @@ do_get_align_cnt( drive_t *drivep )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_emptyp );
>  
>  	/* calculate the next alignment point at or beyond the current nextp.
>  	 * the following algorithm works because dc_buf is page-aligned and
> @@ -1317,7 +1318,7 @@ do_get_align_cnt( drive_t *drivep )
>  	next_alignment_off +=  PGMASK;
>  	next_alignment_off &= ~PGMASK;
>  	next_alignment_point = ( char * )next_alignment_off;
> -	ASSERT( next_alignment_point <= contextp->dc_emptyp );
> +	assert( next_alignment_point <= contextp->dc_emptyp );
>  
>  	/* return the number of bytes to the next alignment point
>  	 */
> @@ -1338,14 +1339,14 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_WRITE );
> -	ASSERT( ! contextp->dc_ownedp );
> -	ASSERT( contextp->dc_nextp );
> -	ASSERT( contextp->dc_nextp < contextp->dc_emptyp );
> +	assert( contextp->dc_mode == OM_WRITE );
> +	assert( ! contextp->dc_ownedp );
> +	assert( contextp->dc_nextp );
> +	assert( contextp->dc_nextp < contextp->dc_emptyp );
>  
>  	/* calculate length of un-written portion of buffer
>  	 */
> -	ASSERT( contextp->dc_nextp >= contextp->dc_buf );
> +	assert( contextp->dc_nextp >= contextp->dc_buf );
>  	remaining_bufsz = ( size_t )( contextp->dc_nextp - contextp->dc_buf );
>  
>  	if ( remaining_bufsz ) {
> @@ -1387,7 +1388,7 @@ do_end_write( drive_t *drivep, off64_t *ncommittedp )
>  	/* bump the file mark cnt
>  	 */
>  	contextp->dc_fmarkcnt++;
> -	ASSERT( contextp->dc_fmarkcnt == 1 );
> +	assert( contextp->dc_fmarkcnt == 1 );
>  
>  	*ncommittedp = contextp->dc_bufstroff;
>  	contextp->dc_mode = OM_NONE;
> @@ -1410,15 +1411,15 @@ do_rewind( drive_t *drivep )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( dcaps & DRIVE_CAP_REWIND );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( dcaps & DRIVE_CAP_REWIND );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* seek to beginning of file
>  	 */
>  	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
>  	if ( newoff ) {
> -		ASSERT( newoff < 0 );
> +		assert( newoff < 0 );
>  		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
>  		      _("could not rewind %s: %s\n"),
>  		      drivep->d_pathname,
> @@ -1446,15 +1447,15 @@ do_erase( drive_t *drivep )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( dcaps & DRIVE_CAP_ERASE );
> -	ASSERT( contextp->dc_fd >= 0 );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( dcaps & DRIVE_CAP_ERASE );
> +	assert( contextp->dc_fd >= 0 );
>  
>  	/* seek to beginning of file
>  	 */
>  	newoff = lseek64( contextp->dc_fd, ( off64_t )0, SEEK_SET );
>  	if ( newoff ) {
> -		ASSERT( newoff < 0 );
> +		assert( newoff < 0 );
>  		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_DRIVE,
>  		      _("could not rewind %s in prep for erase: %s\n"),
>  		      drivep->d_pathname,
> @@ -1486,7 +1487,7 @@ do_get_device_class( drive_t *drivep )
>  {
>  	mlog( MLOG_NITTY | MLOG_DRIVE,
>  	      "drive_simple get_device_class( )\n" );
> -	ASSERT( drivep );
> +	assert( drivep );
>  	return DEVICE_NONREMOVABLE;
>  }
>  
> @@ -1500,8 +1501,8 @@ do_quit( drive_t *drivep )
>  
>  	/* assert protocol
>  	 */
> -	ASSERT( contextp->dc_mode == OM_NONE );
> -	ASSERT( contextp );
> +	assert( contextp->dc_mode == OM_NONE );
> +	assert( contextp );
>  
>  	/* close file
>  	 */
> diff --git a/common/fs.c b/common/fs.c
> index 6f4cb6c..b77f6cc 100644
> --- a/common/fs.c
> +++ b/common/fs.c
> @@ -27,6 +27,7 @@
>  #include <fcntl.h>
>  #include <mntent.h>
>  #include <sys/ioctl.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -127,11 +128,11 @@ fs_info( char *typb,		/* out */
>  	if ( canstat && ( statb.st_mode & S_IFMT ) == S_IFBLK ) {
>  		if ( ( tep = fs_tab_lookup_blk( usrs )) != 0 ) {
>  			blks = tep->fte_blks;
> -			ASSERT( strlen( blks ) < ( size_t )blkbz );
> +			assert( strlen( blks ) < ( size_t )blkbz );
>  			strcpy( blkb, blks );
>  			mnts = tep->fte_mnts;
>  			if ( mnts ) {
> -				ASSERT( strlen( mnts ) < ( size_t )mntbz );
> +				assert( strlen( mnts ) < ( size_t )mntbz );
>  				strcpy( mntb, mnts );
>  			} else {
>  				mntb[ 0 ] = 0;
> @@ -139,7 +140,7 @@ fs_info( char *typb,		/* out */
>  			if ( ( typs = tep->fte_typs ) == 0 ) {
>  				typs = typd;
>  			}
> -			ASSERT( strlen( typs ) < ( size_t )typbz );
> +			assert( strlen( typs ) < ( size_t )typbz );
>  			strcpy( typb, typs );
>  			ok = BOOL_TRUE;
>  		} else {
> @@ -147,13 +148,13 @@ fs_info( char *typb,		/* out */
>  		}
>  	} else if ( ( tep = fs_tab_lookup_mnt( usrs )) != 0 ) {
>  		blks = tep->fte_blks;
> -		ASSERT( strlen( blks ) < ( size_t )blkbz );
> +		assert( strlen( blks ) < ( size_t )blkbz );
>  		strcpy( blkb, blks );
>  		mnts = tep->fte_mnts;
> -		ASSERT( strlen( mnts ) < ( size_t )mntbz );
> +		assert( strlen( mnts ) < ( size_t )mntbz );
>  		strcpy( mntb, mnts );
>  		typs = tep->fte_typs;
> -		ASSERT( strlen( typs ) < ( size_t )typbz );
> +		assert( strlen( typs ) < ( size_t )typbz );
>  		strcpy( typb, typs );
>  		ok = BOOL_TRUE;
>  	} else {
> @@ -161,7 +162,7 @@ fs_info( char *typb,		/* out */
>  	}
>  
>  	fs_tab_free( );
> -	ASSERT( ok != BOOL_UNKNOWN );
> +	assert( ok != BOOL_UNKNOWN );
>  
>  	if ( ok == BOOL_TRUE ) {
>  		intgen_t rval = fs_getid( mntb, idb );
> @@ -281,11 +282,11 @@ fs_tab_ent_build( struct mntent *mntentp )
>  	char *cp;
>  
>  	tep = ( fs_tab_ent_t * )calloc( 1, sizeof( fs_tab_ent_t ));
> -	ASSERT( tep );
> +	assert( tep );
>  
>  	if ( mntentp->mnt_dir ) {
>  		cp = calloc( 1, strlen( mntentp->mnt_dir ) + 1 );
> -		ASSERT( cp );
> +		assert( cp );
>  		( void )strcpy( cp, mntentp->mnt_dir );
>  		tep->fte_mnts = cp;
>  	} else {
> @@ -294,7 +295,7 @@ fs_tab_ent_build( struct mntent *mntentp )
>  
>  	if ( mntentp->mnt_type ) {
>  		cp = calloc( 1, strlen( mntentp->mnt_type ) + 1 );
> -		ASSERT( cp );
> +		assert( cp );
>  		( void )strcpy( cp, mntentp->mnt_type );
>  		tep->fte_typs = cp;
>  	} else {
> @@ -303,7 +304,7 @@ fs_tab_ent_build( struct mntent *mntentp )
>  
>  	if ( mntentp->mnt_fsname ) {
>  		cp = calloc( 1, strlen( mntentp->mnt_fsname ) + 1 );
> -		ASSERT( cp );
> +		assert( cp );
>  		( void )strcpy( cp, mntentp->mnt_fsname );
>  		tep->fte_blks = cp;
>  	} else {
> diff --git a/common/global.c b/common/global.c
> index 8e49d8b..ed844cc 100644
> --- a/common/global.c
> +++ b/common/global.c
> @@ -22,6 +22,7 @@
>  #include <sys/stat.h>
>  #include <time.h>
>  #include <errno.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -67,13 +68,13 @@ global_hdr_alloc( intgen_t argc, char *argv[ ] )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( time32_t ) == GLOBAL_HDR_TIME_SZ );
> -	ASSERT( sizeof( uuid_t ) == GLOBAL_HDR_UUID_SZ );
> +	assert( sizeof( time32_t ) == GLOBAL_HDR_TIME_SZ );
> +	assert( sizeof( uuid_t ) == GLOBAL_HDR_UUID_SZ );
>  
>  	/* allocate a global hdr
>  	 */
>  	ghdrp = ( global_hdr_t * )calloc( 1, sizeof( global_hdr_t ));
> -	ASSERT( ghdrp );
> +	assert( ghdrp );
>  
>  	/* fill in the magic number
>  	 */
> @@ -326,7 +327,7 @@ prompt_label( char *bufp, size_t bufsz )
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	responseix = dlog_string_query( prompt_label_cb,
> @@ -348,7 +349,7 @@ prompt_label( char *bufp, size_t bufsz )
>  		ackstr[ ackcnt++ ] = _("session label left blank\n");
>  	}
>  
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_string_ack( ackstr,
>  			 ackcnt );
>  
> @@ -357,7 +358,7 @@ prompt_label( char *bufp, size_t bufsz )
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> diff --git a/common/hsmapi.c b/common/hsmapi.c
> index 7f9b45e..0bca9ff 100644
> --- a/common/hsmapi.c
> +++ b/common/hsmapi.c
> @@ -19,6 +19,7 @@
>  #include <xfs/xfs.h>
>  #include <attr/attributes.h>
>  #include <xfs/jdm.h>
> +#include <assert.h>
>  
>  #include "hsmapi.h"
>  #include "mlog.h"
> diff --git a/common/inventory.c b/common/inventory.c
> index fb27048..681d28f 100644
> --- a/common/inventory.c
> +++ b/common/inventory.c
> @@ -27,6 +27,7 @@
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <sys/stat.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "inventory_priv.h"
> @@ -51,7 +52,7 @@ inv_open( inv_predicate_t bywhat, void *pred )
>  	
>  	int index = 0;
>  	
> -	ASSERT ( pred );
> +	assert ( pred );
>  	if ((fd = init_idb ( pred, bywhat, uuname, &tok )) < 0 )
>  		return tok;
>  
> @@ -66,7 +67,7 @@ inv_open( inv_predicate_t bywhat, void *pred )
>  		return INV_TOKEN_NULL;
>  	}
>  
> -	ASSERT ( index > 0 );
> +	assert ( index > 0 );
>  
>  	/* Now we need to make sure that this has enough space */
>  	num = GET_SESCOUNTERS( stobjfd, &sescnt );
> @@ -145,7 +146,7 @@ inv_lasttime_level_lessthan(
>  	time32_t **tm )
>  {
>  	int 	rval;
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  
>  	rval =  search_invt( tok, level, (void **) tm,
>  			 (search_callback_t) tm_level_lessthan );
> @@ -170,7 +171,7 @@ inv_lastsession_level_lessthan(
>  	inv_session_t 	**ses )
>  {
>  	int 	rval;
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  
>  	rval = search_invt( tok, level, (void **) ses, 
>  			  (search_callback_t) lastsess_level_lessthan );
> @@ -197,7 +198,7 @@ inv_lastsession_level_equalto(
>  	inv_session_t	**ses )
>  {
>  	int 	rval;
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  	rval = search_invt( tok, level, (void **) ses, 
>  			  (search_callback_t) lastsess_level_equalto );
>  
> @@ -236,8 +237,8 @@ inv_writesession_open(
>  	invt_seshdr_t  	hdr;
>  	inv_sestoken_t	sestok;
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> -	ASSERT ( sesid && fsid && mntpt && devpath );
> +	assert ( tok != INV_TOKEN_NULL );
> +	assert ( sesid && fsid && mntpt && devpath );
>  
>  	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
>  		if ( put_fstab_entry( fsid, mntpt, devpath ) < 0 ) {
> @@ -264,7 +265,7 @@ inv_writesession_open(
>  
>  	fd = tok->d_stobj_fd;
>  	
> -	ASSERT ( fd > 0 );
> +	assert ( fd > 0 );
>  
>  	hdr.sh_time = time;
>  	hdr.sh_level = level;	
> @@ -286,7 +287,7 @@ inv_writesession_open(
>  	/* create the writesession, and get ready for the streams to come 
>  	   afterwards */
>  	rval = create_session( sestok, fd, sescnt, ses, &hdr );
> -	ASSERT (rval > 0);
> +	assert (rval > 0);
>  
>  
>  	INVLOCK( fd, LOCK_UN );
> @@ -324,7 +325,7 @@ inv_writesession_close( inv_sestoken_t tok )
>  {
>  	int		rval;
>  	
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  
>  	/* now update end_time in the inv index header */
>  	rval = put_sesstime( tok, INVT_ENDTIME );
> @@ -354,7 +355,7 @@ inv_stream_open(
>  	invt_seshdr_t  seshdr;
>  	int fd;
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  	 
>  	stream.st_nmediafiles = 0;
>  	stream.st_interrupted = BOOL_FALSE;
> @@ -505,9 +506,9 @@ inv_put_mediafile(
>  	int 		 rval;
>  
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> -	ASSERT ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
> -	ASSERT ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
> +	assert ( tok != INV_TOKEN_NULL );
> +	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
> +	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
>  
>  	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
>  	
> @@ -627,8 +628,8 @@ inv_get_session(
>  	void		      **bufpp,	/* buf to fill */
>  	size_t		       *bufszp )/* size of that buffer */
>  {
> -	ASSERT( tok != INV_TOKEN_NULL );
> -	ASSERT( tok->sd_invtok );
> +	assert( tok != INV_TOKEN_NULL );
> +	assert( tok->sd_invtok );
>  
>  	/* First get the session header, and the session information. Then
>  	   we can figure out how much space to allocate */
> diff --git a/common/lock.c b/common/lock.c
> index ab5b210..347f6cd 100644
> --- a/common/lock.c
> +++ b/common/lock.c
> @@ -18,6 +18,7 @@
>  
>  #include <xfs/xfs.h>
>  #include <xfs/jdm.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "qlock.h"
> @@ -30,7 +31,7 @@ lock_init( void )
>  {
>  	/* initialization sanity checks
>  	 */
> -	ASSERT( lock_qlockh == QLOCKH_NULL );
> +	assert( lock_qlockh == QLOCKH_NULL );
>  
>  	/* allocate a qlock
>  	 */
> diff --git a/common/main.c b/common/main.c
> index 8e7451f..f392856 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -33,6 +33,7 @@
>  #include <stdint.h>
>  #include <sched.h>
>  #include <pthread.h>
> +#include <assert.h>
>  
>  #include "exit.h"
>  #include "types.h"
> @@ -161,14 +162,14 @@ main( int argc, char *argv[] )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( char_t ) == 1 );
> -	ASSERT( sizeof( u_char_t ) == 1 );
> -	ASSERT( sizeof( int32_t ) == 4 );
> -	ASSERT( sizeof( u_int32_t ) == 4 );
> -	ASSERT( sizeof( size32_t ) == 4 );
> -	ASSERT( sizeof( int64_t ) == 8 );
> -	ASSERT( sizeof( u_int64_t ) == 8 );
> -	ASSERT( sizeof( size64_t ) == 8 );
> +	assert( sizeof( char_t ) == 1 );
> +	assert( sizeof( u_char_t ) == 1 );
> +	assert( sizeof( int32_t ) == 4 );
> +	assert( sizeof( u_int32_t ) == 4 );
> +	assert( sizeof( size32_t ) == 4 );
> +	assert( sizeof( int64_t ) == 8 );
> +	assert( sizeof( u_int64_t ) == 8 );
> +	assert( sizeof( size64_t ) == 8 );
>  
>  	/* record the command name used to invoke
>  	 */
> @@ -365,7 +366,7 @@ main( int argc, char *argv[] )
>  	mlog( MLOG_DEBUG | MLOG_PROC,
>  	      "getpagesize( ) returns %u\n",
>  	      pgsz );
> -	ASSERT( ( intgen_t )pgsz > 0 );
> +	assert( ( intgen_t )pgsz > 0 );
>  	pgmask = pgsz - 1;
>  
>  	/* report parent tid
> @@ -792,7 +793,7 @@ main( int argc, char *argv[] )
>  			mlog_exit_hint(RV_INTR);
>  			stop_in_progress = BOOL_TRUE;
>  			cldmgr_stop( );
> -			ASSERT( stop_timeout >= 0 );
> +			assert( stop_timeout >= 0 );
>  			stop_deadline = now + ( time32_t )stop_timeout;
>  		}
>  		
> @@ -1146,7 +1147,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  				return BOOL_FALSE;
>  			}
>  			optfilename = optarg;
> -			ASSERT( optind > 2 );
> +			assert( optind > 2 );
>  			optfileix = ( ix_t )optind - 2;
>  			break;
>  		}
> @@ -1211,7 +1212,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  	/* allocate an argument buffer
>  	 */
>  	argbuf = ( char * )malloc( sz );
> -	ASSERT( argbuf );
> +	assert( argbuf );
>  
>  	/* copy arg0 (the executable's name ) in first
>  	 */
> @@ -1233,7 +1234,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  		close( fd );
>  		return BOOL_FALSE;
>  	}
> -	ASSERT( ( off64_t )nread == stat.st_size );
> +	assert( ( off64_t )nread == stat.st_size );
>  	p += ( size_t )stat.st_size;
>  	*p++ = ' ';
>  
> @@ -1251,7 +1252,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  	/* null-terminate the entire buffer
>  	 */
>  	*p++ = 0;
> -	ASSERT( ( size_t )( p - argbuf ) <= sz );
> +	assert( ( size_t )( p - argbuf ) <= sz );
>  
>  	/* change newlines and carriage returns into spaces
>  	 */
> @@ -1303,7 +1304,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  	/* allocate a new argv array to hold the tokens
>  	 */
>  	newargv = ( char ** )calloc( tokencnt, sizeof( char * ));
> -	ASSERT( newargv );
> +	assert( newargv );
>  
>  	/* null-terminate tokens and place in new argv, after
>  	 * extracting quotes and escapes
> @@ -1326,7 +1327,7 @@ loadoptfile( intgen_t *argcp, char ***argvp )
>  
>  		/* better not disagree with counting scan!
>  		 */
> -		ASSERT( i < ( intgen_t )tokencnt );
> +		assert( i < ( intgen_t )tokencnt );
>  
>  		/* find the end of the first token
>  		 */
> @@ -1533,7 +1534,7 @@ sigint_dialog( void )
>  			_("\nsession interrupt in progress\n");
>  	}
>  	preamblestr[ preamblecnt++ ] = "\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* top-level query: a function of session interrupt status
> @@ -1541,7 +1542,7 @@ sigint_dialog( void )
>  	querycnt = 0;
>  	querystr[ querycnt++ ] = _("please select one of "
>  				 "the following operations\n");
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	if ( ! stop_in_progress ) {
>  		interruptix = choicecnt;
> @@ -1564,7 +1565,7 @@ sigint_dialog( void )
>  	choicestr[ choicecnt++ ] = _("other controls");
>  	continueix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("continue");
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  
>  	responseix = dlog_multi_query( querystr,
>  				       querycnt,
> @@ -1586,13 +1587,13 @@ sigint_dialog( void )
>  				ackcnt );
>  		querycnt = 0;
>  		querystr[ querycnt++ ] = _("please confirm\n");
> -		ASSERT( querycnt <= QUERYMAX );
> +		assert( querycnt <= QUERYMAX );
>  		choicecnt = 0;
>  		interruptix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("interrupt this session");
>  		nochangeix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("continue");
> -		ASSERT( choicecnt <= CHOICEMAX );
> +		assert( choicecnt <= CHOICEMAX );
>  		responseix = dlog_multi_query( querystr,
>  					       querycnt,
>  					       choicestr,
> @@ -1623,7 +1624,7 @@ sigint_dialog( void )
>  		querycnt = 0;
>  		querystr[ querycnt++ ] = _("please select one of "
>  					 "the following subsystems\n");
> -		ASSERT( querycnt <= QUERYMAX );
> +		assert( querycnt <= QUERYMAX );
>  		choicecnt = 0;
>  		/* number of lines must match number of subsystems
>  		 */
> @@ -1634,7 +1635,7 @@ sigint_dialog( void )
>  		choicestr[ choicecnt++ ] = _("all of the above");
>  		nochangeix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("no change");
> -		ASSERT( choicecnt <= CHOICEMAX );
> +		assert( choicecnt <= CHOICEMAX );
>  		responseix = dlog_multi_query( querystr,
>  					       querycnt,
>  					       choicestr,
> @@ -1664,7 +1665,7 @@ sigint_dialog( void )
>  			querycnt = 0;
>  			querystr[ querycnt++ ] = ("please select one of the "
>  						  "following verbosity levels\n");
> -			ASSERT( querycnt <= QUERYMAX );
> +			assert( querycnt <= QUERYMAX );
>  			choicecnt = 0;
>  			choicestr[ choicecnt++ ] = _("silent");
>  			choicestr[ choicecnt++ ] = _("verbose");
> @@ -1674,7 +1675,7 @@ sigint_dialog( void )
>  			choicestr[ choicecnt++ ] = _("nitty + 1");
>  			nochangeix = choicecnt;
>  			choicestr[ choicecnt++ ] = _("no change");
> -			ASSERT( choicecnt <= CHOICEMAX );
> +			assert( choicecnt <= CHOICEMAX );
>  			responseix = dlog_multi_query( querystr,
>  						       querycnt,
>  						       choicestr,
> @@ -1708,7 +1709,7 @@ sigint_dialog( void )
>  			} else {
>  				if ( ssselected < 0 ) {
>  					ix_t ssix;
> -					ASSERT( ssselected == -1 );
> +					assert( ssselected == -1 );
>  					for ( ssix = 0
>  					      ;
>  					      ssix < MLOG_SS_CNT
> @@ -1734,7 +1735,7 @@ sigint_dialog( void )
>  		querycnt = 0;
>  		querystr[ querycnt++ ] = _("please select one of "
>  					  "the following metrics\n");
> -		ASSERT( querycnt <= QUERYMAX );
> +		assert( querycnt <= QUERYMAX );
>  		choicecnt = 0;
>  		ioix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("I/O");
> @@ -1746,7 +1747,7 @@ sigint_dialog( void )
>  #endif /* RESTORE */
>  		nochangeix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("continue");
> -		ASSERT( choicecnt <= CHOICEMAX );
> +		assert( choicecnt <= CHOICEMAX );
>  		responseix = dlog_multi_query( querystr,
>  					       querycnt,
>  					       choicestr,
> @@ -1779,11 +1780,11 @@ sigint_dialog( void )
>  		if ( responseix != nochangeix ) {
>  			querycnt = 0;
>  			querystr[ querycnt++ ] = "\n";
> -			ASSERT( querycnt <= QUERYMAX );
> +			assert( querycnt <= QUERYMAX );
>  			choicecnt = 0;
>  			nochangeix = choicecnt;
>  			choicestr[ choicecnt++ ] = _("continue");
> -			ASSERT( choicecnt <= CHOICEMAX );
> +			assert( choicecnt <= CHOICEMAX );
>  			responseix = dlog_multi_query( querystr,
>  						       querycnt,
>  						       choicestr,
> @@ -1818,7 +1819,7 @@ sigint_dialog( void )
>  		querycnt = 0;
>  		querystr[ querycnt++ ] = _("please select one of "
>  					   "the following controls\n");
> -		ASSERT( querycnt <= QUERYMAX );
> +		assert( querycnt <= QUERYMAX );
>  		choicecnt = 0;
>  		progix = choicecnt;
>  		if ( progrpt_enabledpr ) {
> @@ -1847,7 +1848,7 @@ sigint_dialog( void )
>  		}
>  		nochangeix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("continue");
> -		ASSERT( choicecnt <= CHOICEMAX );
> +		assert( choicecnt <= CHOICEMAX );
>  		responseix = dlog_multi_query( querystr,
>  					       querycnt,
>  					       choicestr,
> @@ -1898,7 +1899,7 @@ sigint_dialog( void )
>  							sprintf( intervalbuf,
>  								 _("%d seconds\n"),
>  								 newinterval );
> -							ASSERT( strlen( intervalbuf )
> +							assert( strlen( intervalbuf )
>  								<
>  								sizeof( intervalbuf ));
>  							ackstr[ ackcnt++ ] = intervalbuf;
> @@ -1911,7 +1912,7 @@ sigint_dialog( void )
>  						sprintf( intervalbuf,
>  							 _("%d second intervals\n"),
>  							 newinterval );
> -						ASSERT( strlen( intervalbuf )
> +						assert( strlen( intervalbuf )
>  							<
>  							sizeof( intervalbuf ));
>  						ackstr[ ackcnt++ ] = intervalbuf;
> @@ -1966,7 +1967,7 @@ sigint_dialog( void )
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> @@ -2009,7 +2010,7 @@ sigintstr( void )
>  	} else {
>  		sprintf( buf, "%c", intchr );
>  	}
> -	ASSERT( strlen( buf ) < sizeof( buf ));
> +	assert( strlen( buf ) < sizeof( buf ));
>  
>  	return buf;
>  }
> @@ -2030,11 +2031,11 @@ set_rlimits( size64_t *vmszp )
>  	/* REFERENCED */
>  	intgen_t rval;
>  
> -	ASSERT( minstacksz <= maxstacksz );
> +	assert( minstacksz <= maxstacksz );
>  
>  	rval = getrlimit64( RLIMIT_AS, &rlimit64 );
>  
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_AS org cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
> @@ -2044,7 +2045,7 @@ set_rlimits( size64_t *vmszp )
>  		rlimit64.rlim_cur = rlimit64.rlim_max;
>  		( void )setrlimit64( RLIMIT_AS, &rlimit64 );
>  		rval = getrlimit64( RLIMIT_AS, &rlimit64 );
> -		ASSERT( ! rval );
> +		assert( ! rval );
>  		mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  			"RLIMIT_VMEM now cur 0x%llx max 0x%llx\n",
>  			rlimit64.rlim_cur,
> @@ -2054,9 +2055,9 @@ set_rlimits( size64_t *vmszp )
>  	vmsz = ( size64_t )rlimit64.rlim_cur;
>  #endif /* RESTORE */
>  	
> -	ASSERT( minstacksz <= maxstacksz );
> +	assert( minstacksz <= maxstacksz );
>  	rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_STACK org cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
> @@ -2076,7 +2077,7 @@ set_rlimits( size64_t *vmszp )
>  			rlimit64.rlim_max = minstacksz;
>  			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
>  			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
> -			ASSERT( ! rval );
> +			assert( ! rval );
>  			if ( rlimit64.rlim_cur < minstacksz ) {
>  				mlog( MLOG_NORMAL
>  				      |
> @@ -2103,7 +2104,7 @@ set_rlimits( size64_t *vmszp )
>  			rlimit64.rlim_cur = minstacksz;
>  			( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
>  			rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
> -			ASSERT( ! rval );
> +			assert( ! rval );
>  			if ( rlimit64.rlim_cur < minstacksz ) {
>  				mlog( MLOG_NORMAL
>  				      |
> @@ -2131,7 +2132,7 @@ set_rlimits( size64_t *vmszp )
>  		rlimit64.rlim_cur = maxstacksz;
>  		( void )setrlimit64( RLIMIT_STACK, &rlimit64 );
>  		rval = getrlimit64( RLIMIT_STACK, &rlimit64 );
> -		ASSERT( ! rval );
> +		assert( ! rval );
>  		if ( rlimit64.rlim_cur > maxstacksz ) {
>  			mlog( MLOG_NORMAL
>  			      |
> @@ -2152,14 +2153,14 @@ set_rlimits( size64_t *vmszp )
>  	      rlimit64.rlim_max );
>  
>  	rval = getrlimit64( RLIMIT_DATA, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_DATA org cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
>  	      rlimit64.rlim_max );
>  	
>  	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_FSIZE org cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
> @@ -2169,14 +2170,14 @@ set_rlimits( size64_t *vmszp )
>  	rlimit64.rlim_cur = RLIM64_INFINITY;
>  	( void )setrlimit64( RLIMIT_FSIZE, &rlimit64 );
>  	rval = getrlimit64( RLIMIT_FSIZE, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_FSIZE now cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
>  	      rlimit64.rlim_max );
>  	
>  	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_CPU cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
> @@ -2184,7 +2185,7 @@ set_rlimits( size64_t *vmszp )
>  	rlimit64.rlim_cur = rlimit64.rlim_max;
>  	( void )setrlimit64( RLIMIT_CPU, &rlimit64 );
>  	rval = getrlimit64( RLIMIT_CPU, &rlimit64 );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	mlog( MLOG_NITTY | MLOG_NOLOCK | MLOG_PROC,
>  	      "RLIMIT_CPU now cur 0x%llx max 0x%llx\n",
>  	      rlimit64.rlim_cur,
> diff --git a/common/media.c b/common/media.c
> index 4ad7776..53b94d1 100644
> --- a/common/media.c
> +++ b/common/media.c
> @@ -26,6 +26,7 @@
>  #include <sys/dirent.h>
>  #include <stdio.h>
>  #include <getopt.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -91,8 +92,8 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
>  
>  	/* sanity check asserts
>  	 */
> -	ASSERT( sizeof( media_hdr_t ) == MEDIA_HDR_SZ );
> -	ASSERT( MEDIA_MARKLOG_SZ == sizeof( media_marklog_t ));
> +	assert( sizeof( media_hdr_t ) == MEDIA_HDR_SZ );
> +	assert( MEDIA_MARKLOG_SZ == sizeof( media_marklog_t ));
>  
>  	/* scan the command line for a media label
>  	 */
> @@ -143,7 +144,7 @@ media_create( int argc, char *argv[ ], drive_strategy_t *dsp )
>  	 */
>  	mediacnt = dsp->ds_drivecnt;
>  	mediapp = ( media_t ** )calloc( mediacnt, sizeof( media_t * ));
> -	ASSERT( mediapp );
> +	assert( mediapp );
>  	for ( mediaix = 0 ; mediaix < mediacnt ; mediaix++ ) {
>  		mediapp[ mediaix ] = media_alloc( dsp->ds_drivep[ mediaix ],
>  					 	  medialabel );
> @@ -266,7 +267,7 @@ media_alloc( drive_t *drivep,
>  	size_t mwhdrsz;
>  
>  	mediap = ( media_t * )calloc( 1, sizeof( media_t ));
> -	ASSERT( mediap );
> +	assert( mediap );
>  
>  	grhdrp = 0;
>  	gwhdrp = 0;
> @@ -279,12 +280,12 @@ media_alloc( drive_t *drivep,
>  			      &gwhdrp,
>  			      ( char ** )&mwhdrp,
>  			      &mwhdrsz );
> -	ASSERT( grhdrp );
> -	ASSERT( gwhdrp );
> -	ASSERT( mrhdrp );
> -	ASSERT( mwhdrp );
> -	ASSERT( mrhdrsz == MEDIA_HDR_SZ );
> -	ASSERT( mwhdrsz == MEDIA_HDR_SZ );
> +	assert( grhdrp );
> +	assert( gwhdrp );
> +	assert( mrhdrp );
> +	assert( mwhdrp );
> +	assert( mrhdrsz == MEDIA_HDR_SZ );
> +	assert( mwhdrsz == MEDIA_HDR_SZ );
>  
>  	mediap->m_greadhdrp = grhdrp;
>  	mediap->m_gwritehdrp = gwhdrp;
> diff --git a/common/mlog.c b/common/mlog.c
> index b0135b9..c546036 100644
> --- a/common/mlog.c
> +++ b/common/mlog.c
> @@ -27,6 +27,7 @@
>  #include <time.h>
>  #include <getopt.h>
>  #include <pthread.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "qlock.h"
> @@ -157,9 +158,9 @@ mlog_init1( intgen_t argc, char *argv[ ] )
>  	vsymcnt = sizeof( mlog_sym ) / sizeof( mlog_sym[ 0 ] );
>  	suboptstrs = ( char ** )calloc( MLOG_SS_CNT + vsymcnt + 1,
>  					sizeof( char * ));
> -	ASSERT( suboptstrs );
> +	assert( suboptstrs );
>  	for ( soix = 0 ; soix < MLOG_SS_CNT ; soix++ ) {
> -		ASSERT( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
> +		assert( strlen( mlog_ss_names[ soix ] ) <= MLOG_SS_NAME_MAX );
>  			/* unrelated, but opportunity to chk */
>  		suboptstrs[ soix ] = mlog_ss_names[ soix ];
>  	}
> @@ -210,7 +211,7 @@ mlog_init1( intgen_t argc, char *argv[ ] )
>  					usage( );
>  					return BOOL_FALSE;
>  				}
> -				ASSERT( ( ix_t )suboptix
> +				assert( ( ix_t )suboptix
>  					<
>  					MLOG_SS_CNT + vsymcnt );
>  				if ( suboptix < MLOG_SS_CNT ) {
> @@ -273,8 +274,8 @@ mlog_init1( intgen_t argc, char *argv[ ] )
>  	 */
>  	for ( ssix = 0 ; ssix < MLOG_SS_CNT ; ssix++ ) {
>  		if ( mlog_level_ss[ ssix ] < 0 ) {
> -			ASSERT( mlog_level_ss[ ssix ] == -1 );
> -			ASSERT( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
> +			assert( mlog_level_ss[ ssix ] == -1 );
> +			assert( mlog_level_ss[ MLOG_SS_GEN ] >= 0 );
>  			mlog_level_ss[ ssix ] = mlog_level_ss[ MLOG_SS_GEN ];
>  		}
>  	}
> @@ -375,7 +376,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
>  	level = levelarg & MLOG_LEVELMASK;
>  	ss = ( ix_t )( ( levelarg & MLOG_SS_MASK ) >> MLOG_SS_SHIFT );
>  
> -	ASSERT( ss < MLOG_SS_CNT );
> +	assert( ss < MLOG_SS_CNT );
>  	if ( level > mlog_level_ss[ ss ] ) {
>  		return;
>  	}
> @@ -402,7 +403,7 @@ mlog_va( intgen_t levelarg, char *fmt, va_list args )
>  				 tmp->tm_hour,
>  				 tmp->tm_min,
>  				 tmp->tm_sec );
> -			ASSERT( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
> +			assert( strlen( mlog_tsstr ) < sizeof( mlog_tsstr ));
>  		} else {
>  			mlog_tsstr[ 0 ] = 0;
>  		}
> @@ -676,7 +677,7 @@ mlog_get_hint( void )
>  
>  	ok = stream_get_exit_status(pthread_self(), states, N(states),
>  				    NULL, NULL, NULL, NULL, &hint);
> -	ASSERT(ok);
> +	assert(ok);
>  	return hint;
>  }
>  
> @@ -736,7 +737,7 @@ mlog_exit_flush(void)
>  						    &exit_code,
>  						    &exit_return,
>  						    &exit_hint);
> -			ASSERT(ok);
> +			assert(ok);
>  
>  			/* hint takes priority over return */
>  			rv = (exit_hint != RV_NONE) ? exit_hint : exit_return;
> @@ -771,7 +772,7 @@ mlog_exit_flush(void)
>  	else if (IS_INCOMPLETE(rv)) incomplete = BOOL_TRUE;
>  
>  	/* if we don't have an exit code here there is a problem */
> -	ASSERT(VALID_EXIT_CODE(mlog_main_exit_code));
> +	assert(VALID_EXIT_CODE(mlog_main_exit_code));
>  	if (interrupt) status_str = "INTERRUPT";
>  	else if (quit) status_str = "QUIT";
>  	else if (incomplete) status_str = "INCOMPLETE";
> diff --git a/common/openutil.c b/common/openutil.c
> index 9a88d67..c3b8d9a 100644
> --- a/common/openutil.c
> +++ b/common/openutil.c
> @@ -22,6 +22,7 @@
>  #include <limits.h>
>  #include <errno.h>
>  #include <fcntl.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -56,7 +57,7 @@ open_pathalloc( char *dirname, char *basename, pid_t pid )
>    	}
>  	namelen = dirlen + 1 + strlen( basename ) + pidlen + 1;
>  	namebuf = ( char * )calloc( 1, namelen );
> -  	ASSERT( namebuf );
> +  	assert( namebuf );
>  
>    	if ( pid ) {
>  		( void )snprintf( namebuf, namelen, "%s/%s.%d", dirname, basename, pid );
> diff --git a/common/path.c b/common/path.c
> index ca24f6a..e40c473 100644
> --- a/common/path.c
> +++ b/common/path.c
> @@ -17,6 +17,7 @@
>   */
>  
>  #include <xfs/xfs.h>
> +#include <assert.h>
>  
>  #include "path.h"
>  
> @@ -51,8 +52,8 @@ path_diff( char *path, char *base )
>  {
>  	char *diff;
>  
> -	ASSERT( *base == '/' );
> -	ASSERT( *path == '/' );
> +	assert( *base == '/' );
> +	assert( *path == '/' );
>  
>  	if ( ! path_beginswith( path, base )) {
>  		return 0;
> @@ -70,7 +71,7 @@ path_diff( char *path, char *base )
>  	}
>  
>  	diff = ( char * )calloc( 1, strlen( path ) + 1 );
> -	ASSERT( diff );
> +	assert( diff );
>  	strcpy( diff, path );
>  
>  	return diff;
> @@ -102,7 +103,7 @@ path_reltoabs( char *dir, char *basedir )
>  					   strlen( dir )
>  					   +
>  					   1 );
> -		ASSERT( absdir );
> +		assert( absdir );
>  
>  		( void )sprintf( absdir, "%s/%s", basedir, dir );
>  
> @@ -127,7 +128,7 @@ path_normalize( char *path )
>  	char *pep;
>  	char *npath;
>  
> -	ASSERT( path[ 0 ] == '/' );
> +	assert( path[ 0 ] == '/' );
>  
>  	while ( ( pep = pem_next( pemp )) != 0 ) {
>  		if ( ! strcmp( pep, "" )) {
> @@ -163,7 +164,7 @@ static pem_t *
>  pem_alloc( char *path )
>  {
>  	pem_t *pemp = ( pem_t * )calloc( 1, sizeof( pem_t ));
> -	ASSERT( pemp );
> +	assert( pemp );
>  	pemp->pem_head = path;
>  	pemp->pem_next = pemp->pem_head;
>  
> @@ -207,7 +208,7 @@ pem_next( pem_t *pemp )
>  	/* allocate buffer to hold the path element, incl null termination
>  	 */
>  	p = ( char * )malloc( len + 1 );
> -	ASSERT( p );
> +	assert( p );
>  
>  	/* copy the path element into the buffer
>  	 */
> @@ -230,7 +231,7 @@ static pa_t *
>  pa_alloc( void )
>  {
>  	pa_t *pap = ( pa_t * )calloc( 1, sizeof( pa_t ));
> -	ASSERT( pap );
> +	assert( pap );
>  
>  	return pap;
>  }
> @@ -250,7 +251,7 @@ pa_free( pa_t *pap )
>  static void
>  pa_append( pa_t *pap, char *pep )
>  {
> -	ASSERT( pap->pa_cnt < PAMAX );
> +	assert( pap->pa_cnt < PAMAX );
>  
>  	pap->pa_array[ pap->pa_cnt ] = pep;
>  
> @@ -261,12 +262,12 @@ static int
>  pa_peel( pa_t *pap )
>  {
>  	if ( pap->pa_cnt <= 0 ) {
> -		ASSERT( pap->pa_cnt == 0 );
> +		assert( pap->pa_cnt == 0 );
>  		return 0;
>  	}
>  
>  	pap->pa_cnt--;
> -	ASSERT( pap->pa_array[ pap->pa_cnt ] );
> +	assert( pap->pa_array[ pap->pa_cnt ] );
>  	free( ( void * )pap->pa_array[ pap->pa_cnt ] );
>  	pap->pa_array[ pap->pa_cnt ] = 0;
>  
> @@ -292,7 +293,7 @@ pa_gen( pa_t *pap )
>  	retp = ( char * )malloc( sz );
>  
>  	if (  pap->pa_cnt <= 0 ) {
> -		ASSERT(  pap->pa_cnt == 0 );
> +		assert(  pap->pa_cnt == 0 );
>  		sprintf( retp, "/" );
>  	} else {
>  		p = retp;
> diff --git a/common/qlock.c b/common/qlock.c
> index ae8466d..d88917c 100644
> --- a/common/qlock.c
> +++ b/common/qlock.c
> @@ -21,6 +21,7 @@
>  
>  #include <pthread.h>
>  #include <semaphore.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "qlock.h"
> @@ -78,13 +79,13 @@ qlock_alloc( ix_t ord )
>  
>  	/* verify the ordinal is not already taken, and mark as taken
>  	 */
> -	ASSERT( ! QLOCK_ORDMAP_GET( qlock_ordalloced, ord ));
> +	assert( ! QLOCK_ORDMAP_GET( qlock_ordalloced, ord ));
>  	QLOCK_ORDMAP_SET( qlock_ordalloced, ord );
>  
>  	/* allocate lock memory
>  	 */
>  	qlockp = ( qlock_t * )calloc( 1, sizeof( qlock_t ));
> -	ASSERT( qlockp );
> +	assert( qlockp );
>  
>  	/* initialize the mutex
>  	 */
> @@ -118,7 +119,7 @@ qlock_lock( qlockh_t qlockh )
>  		      qlockp->ql_ord,
>  		      thread_ordmap );
>  	}
> -	ASSERT( ! QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
> +	assert( ! QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
>  
>  	/* assert that no locks with a lesser ordinal are held by this thread
>  	 */
> @@ -129,12 +130,12 @@ qlock_lock( qlockh_t qlockh )
>  		      qlockp->ql_ord,
>  		      thread_ordmap );
>  	}
> -	ASSERT( ! QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord ));
> +	assert( ! QLOCK_ORDMAP_CHK( thread_ordmap, qlockp->ql_ord ));
>  
>  	/* acquire the lock
>  	 */
>  	rval = pthread_mutex_lock( &qlockp->ql_mutex );
> -	ASSERT( !rval );
> +	assert( !rval );
>  
>  	/* add ordinal to this threads ordmap
>  	 */
> @@ -150,7 +151,7 @@ qlock_unlock( qlockh_t qlockh )
>  	
>  	/* verify lock is held by this thread
>  	 */
> -	ASSERT( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
> +	assert( QLOCK_ORDMAP_GET( thread_ordmap, qlockp->ql_ord ));
>  
>  	/* clear lock's ord from thread's ord map
>  	 */
> @@ -159,7 +160,7 @@ qlock_unlock( qlockh_t qlockh )
>  	/* release the lock
>  	 */
>  	rval = pthread_mutex_unlock( &qlockp->ql_mutex );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  }
>  
>  qsemh_t
> @@ -171,12 +172,12 @@ qsem_alloc( ix_t cnt )
>  	/* allocate a semaphore
>  	 */
>  	semp = ( sem_t * )calloc( 1, sizeof( sem_t ));
> -	ASSERT( semp );
> +	assert( semp );
>  
>  	/* initialize the semaphore
>  	 */
>  	rval = sem_init( semp, 0, cnt );
> -	ASSERT( !rval );
> +	assert( !rval );
>  
>  	return ( qsemh_t )semp;
>  }
> @@ -190,7 +191,7 @@ qsem_free( qsemh_t qsemh )
>  	/* destroy the mutex and condition
>  	 */
>  	rval = sem_destroy( semp );
> -	ASSERT( !rval );
> +	assert( !rval );
>  
>  	/* free the semaphore
>  	 */
> @@ -206,7 +207,7 @@ qsemP( qsemh_t qsemh )
>  	/* "P" the semaphore
>  	 */
>  	rval = sem_wait( semp );
> -	ASSERT( !rval );
> +	assert( !rval );
>  }
>  
>  void
> @@ -218,7 +219,7 @@ qsemV( qsemh_t qsemh )
>  	/* "V" the semaphore
>  	 */
>  	rval = sem_post( semp );
> -	ASSERT( !rval );
> +	assert( !rval );
>  }
>  
>  bool_t
> @@ -229,7 +230,7 @@ qsemPwouldblock( qsemh_t qsemh )
>  	intgen_t rval;
>  
>  	rval = sem_getvalue( semp, &count );
> -	ASSERT( !rval );
> +	assert( !rval );
>  
>  	return count <= 0 ? BOOL_TRUE : BOOL_FALSE;
>  }
> @@ -242,7 +243,7 @@ qsemPavail( qsemh_t qsemh )
>  	intgen_t rval;
>  
>  	rval = sem_getvalue( semp, &count );
> -	ASSERT( !rval );
> +	assert( !rval );
>  
>  	return count < 0 ? 0 : count;
>  }
> diff --git a/common/ring.c b/common/ring.c
> index 0d2feb0..f3de7c4 100644
> --- a/common/ring.c
> +++ b/common/ring.c
> @@ -27,6 +27,7 @@
>  #include <stdlib.h>
>  #include <unistd.h>
>  #include <malloc.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "qlock.h"
> @@ -56,7 +57,7 @@ ring_create( size_t ringlen,
>  	/* allocate a ring descriptor
>  	 */
>  	ringp = ( ring_t * )calloc( 1, sizeof( ring_t ));
> -	ASSERT( ringp );
> +	assert( ringp );
>  	ringp->r_len = ringlen;
>  	ringp->r_clientctxp = clientctxp;
>  	ringp->r_readfunc = readfunc;
> @@ -86,7 +87,7 @@ ring_create( size_t ringlen,
>  	/* allocate the ring messages
>  	 */
>  	ringp->r_msgp = ( ring_msg_t * )calloc( ringlen, sizeof( ring_msg_t ));
> -	ASSERT( ringp->r_msgp );
> +	assert( ringp->r_msgp );
>  
>  	/* allocate the buffers and initialize the messages
>  	 */
> @@ -115,7 +116,7 @@ ring_create( size_t ringlen,
>  					*rvalp = EPERM;
>  					return 0;
>  				}
> -				ASSERT( 0 );
> +				assert( 0 );
>  			}
>  		}
>  	}
> @@ -126,7 +127,7 @@ ring_create( size_t ringlen,
>  			    drive_index,
>  			    _("slave"),
>  			    ringp );
> -	ASSERT( ok );
> +	assert( ok );
>  
>  	return ringp;
>  }
> @@ -138,7 +139,7 @@ ring_get( ring_t *ringp )
>  
>  	/* assert client currently holds no messages
>  	 */
> -	ASSERT( ringp->r_client_cnt == 0 );
> +	assert( ringp->r_client_cnt == 0 );
>  
>  	/* bump client message count and note if client needs to block
>  	 */
> @@ -157,11 +158,11 @@ ring_get( ring_t *ringp )
>  
>  	/* assert the message is where it belongs
>  	 */
> -	ASSERT( msgp->rm_loc == RING_LOC_READY );
> +	assert( msgp->rm_loc == RING_LOC_READY );
>  
>  	/* verify the message index has not become corrupted
>  	 */
> -	ASSERT( msgp->rm_mix == ringp->r_ready_out_ix );
> +	assert( msgp->rm_mix == ringp->r_ready_out_ix );
>  
>  	/* bump the output index
>  	 */
> @@ -187,15 +188,15 @@ ring_put( ring_t *ringp, ring_msg_t *msgp )
>  {
>  	/* assert the client holds exactly one message
>  	 */
> -	ASSERT( ringp->r_client_cnt == 1 );
> +	assert( ringp->r_client_cnt == 1 );
>  
>  	/* assert the client is returning the right message
>  	 */
> -	ASSERT( msgp->rm_mix == ringp->r_active_in_ix );
> +	assert( msgp->rm_mix == ringp->r_active_in_ix );
>  
>  	/* assert the message is where it belongs
>  	 */
> -	ASSERT( msgp->rm_loc == RING_LOC_CLIENT );
> +	assert( msgp->rm_loc == RING_LOC_CLIENT );
>  
>  	/* decrement the count of messages held by the client
>  	 */
> @@ -224,13 +225,13 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
>  	/* if the client is not holding a message, get the next message
>  	 */
>  	if ( ringp->r_client_cnt == 0 ) {
> -		ASSERT( ! msgp );
> +		assert( ! msgp );
>  		msgp = ring_get( ringp );
> -		ASSERT( msgp );
> -		ASSERT( ringp->r_client_cnt == 1 );
> +		assert( msgp );
> +		assert( ringp->r_client_cnt == 1 );
>  	} else {
> -		ASSERT( msgp );
> -		ASSERT( ringp->r_client_cnt == 1 );
> +		assert( msgp );
> +		assert( ringp->r_client_cnt == 1 );
>  	}
>  
>  	/* tell the slave to abort
> @@ -240,24 +241,24 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
>  
>  	/* wait for the reset to be acknowledged
>  	 */
> -	ASSERT( ringp->r_client_cnt == 0 );
> +	assert( ringp->r_client_cnt == 0 );
>  	do {
>  		/* pull a message from the ready queue
>  		 */
>  		qsemP( ringp->r_ready_qsemh );
>  		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
> -		ASSERT( msgp->rm_loc == RING_LOC_READY );
> +		assert( msgp->rm_loc == RING_LOC_READY );
>  		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
>  					%
>  					ringp->r_len;
>  		ringp->r_client_cnt++;
>  	} while ( msgp->rm_stat != RING_STAT_RESETACK );
> -	ASSERT( ringp->r_client_cnt == ringp->r_len );
> +	assert( ringp->r_client_cnt == ringp->r_len );
>  
>  	/* re-initialize the ring
>  	 */
> -	ASSERT( qsemPavail( ringp->r_ready_qsemh ) == 0 );
> -	ASSERT( qsemPavail( ringp->r_active_qsemh ) == 0 );
> +	assert( qsemPavail( ringp->r_ready_qsemh ) == 0 );
> +	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
>  	ringp->r_ready_in_ix = 0;
>  	ringp->r_ready_out_ix = 0;
>  	ringp->r_active_in_ix = 0;
> @@ -273,8 +274,8 @@ ring_reset( ring_t *ringp, ring_msg_t *msgp )
>  		msgp->rm_loc = RING_LOC_READY;
>  		qsemV( ringp->r_ready_qsemh );
>  	}
> -	ASSERT( qsemPavail( ringp->r_ready_qsemh ) == ringp->r_len );
> -	ASSERT( qsemPavail( ringp->r_active_qsemh ) == 0 );
> +	assert( qsemPavail( ringp->r_ready_qsemh ) == ringp->r_len );
> +	assert( qsemPavail( ringp->r_active_qsemh ) == 0 );
>  }
>  
>  void
> @@ -284,7 +285,7 @@ ring_destroy( ring_t *ringp )
>  
>  	/* the client must not be holding a message
>  	 */
> -	ASSERT( ringp->r_client_cnt == 0 );
> +	assert( ringp->r_client_cnt == 0 );
>  
>  	/* get a message
>  	 */
> @@ -302,7 +303,7 @@ ring_destroy( ring_t *ringp )
>  		 */
>  		qsemP( ringp->r_ready_qsemh );
>  		msgp = &ringp->r_msgp[ ringp->r_ready_out_ix ];
> -		ASSERT( msgp->rm_loc == RING_LOC_READY );
> +		assert( msgp->rm_loc == RING_LOC_READY );
>  		ringp->r_ready_out_ix = ( ringp->r_ready_out_ix + 1 )
>  					%
>  					ringp->r_len;
> @@ -323,7 +324,7 @@ ring_slave_get( ring_t *ringp )
>  
>  	/* assert slave currently holds no messages
>  	 */
> -	ASSERT( ringp->r_slave_cnt == 0 );
> +	assert( ringp->r_slave_cnt == 0 );
>  
>  	/* bump slave message count and note if slave needs to block
>  	 */
> @@ -342,11 +343,11 @@ ring_slave_get( ring_t *ringp )
>  
>  	/* assert the message is where it belongs
>  	 */
> -	ASSERT( msgp->rm_loc == RING_LOC_ACTIVE );
> +	assert( msgp->rm_loc == RING_LOC_ACTIVE );
>  
>  	/* verify the message index has not become corrupted
>  	 */
> -	ASSERT( msgp->rm_mix == ringp->r_active_out_ix );
> +	assert( msgp->rm_mix == ringp->r_active_out_ix );
>  
>  	/* bump the output index
>  	 */
> @@ -372,15 +373,15 @@ ring_slave_put( ring_t *ringp, ring_msg_t *msgp )
>  {
>  	/* assert the slave holds exactly one message
>  	 */
> -	ASSERT( ringp->r_slave_cnt == 1 );
> +	assert( ringp->r_slave_cnt == 1 );
>  
>  	/* assert the slave is returning the right message
>  	 */
> -	ASSERT( msgp->rm_mix == ringp->r_ready_in_ix );
> +	assert( msgp->rm_mix == ringp->r_ready_in_ix );
>  
>  	/* assert the message is where it belongs
>  	 */
> -	ASSERT( msgp->rm_loc == RING_LOC_SLAVE );
> +	assert( msgp->rm_loc == RING_LOC_SLAVE );
>  
>  	/* decrement the count of messages held by the slave
>  	 */
> @@ -435,7 +436,7 @@ ring_slave_entry( void *ringctxp )
>  			}
>  			if ( ! ringp->r_first_io_time ) {
>  				ringp->r_first_io_time = time( 0 );
> -				ASSERT( ringp->r_first_io_time );
> +				assert( ringp->r_first_io_time );
>  			}
>  			rval = ( ringp->r_readfunc )( ringp->r_clientctxp,
>  						      msgp->rm_bufp );
> @@ -455,7 +456,7 @@ ring_slave_entry( void *ringctxp )
>  			}
>  			if ( ! ringp->r_first_io_time ) {
>  				ringp->r_first_io_time = time( 0 );
> -				ASSERT( ringp->r_first_io_time );
> +				assert( ringp->r_first_io_time );
>  			}
>  			rval = ( ringp->r_writefunc )( ringp->r_clientctxp,
>  						       msgp->rm_bufp );
> diff --git a/common/stream.c b/common/stream.c
> index 6704661..0db1be3 100644
> --- a/common/stream.c
> +++ b/common/stream.c
> @@ -20,6 +20,7 @@
>  #include <xfs/jdm.h>
>  
>  #include <pthread.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "exit.h"
> @@ -65,7 +66,7 @@ stream_register( pthread_t tid, intgen_t streamix )
>  	spm_t *p = spm;
>  	spm_t *ep = spm + N(spm);
>  
> -	ASSERT( streamix < STREAM_SIMMAX );
> +	assert( streamix < STREAM_SIMMAX );
>  
>  	lock();
>  	for ( ; p < ep ; p++ ) {
> @@ -75,7 +76,7 @@ stream_register( pthread_t tid, intgen_t streamix )
>  		}
>  	}
>  	unlock();
> -	ASSERT( p < ep );
> +	assert( p < ep );
>  
>  	if ( p >= ep ) return;
>  
> @@ -98,7 +99,7 @@ stream_dead( pthread_t tid )
>  			p->s_state = S_ZOMBIE;
>  			break;
>  		}
> -	ASSERT( p < ep );
> +	assert( p < ep );
>  }
>  
>  void
> @@ -116,7 +117,7 @@ stream_free( pthread_t tid )
>  		}
>  	}
>  	unlock();
> -	ASSERT( p < ep );
> +	assert( p < ep );
>  }
>  
>  int
> @@ -126,7 +127,7 @@ stream_find_all( stream_state_t states[], int nstates,
>  	int i, count = 0;
>  	spm_t *p = spm;
>  	spm_t *ep = spm + N(spm);
> -	ASSERT(nstates > 0 && ntids > 0);
> +	assert(nstates > 0 && ntids > 0);
>  
>  	if (!initialized)
>  		return 0;
> @@ -150,7 +151,7 @@ stream_find( pthread_t tid, stream_state_t s[], int nstates )
>  	spm_t *p = spm;
>  	spm_t *ep = spm + N(spm);
>  
> -	ASSERT(nstates > 0);
> +	assert(nstates > 0);
>  
>  	/* note we don't lock the stream array in this function */
>  	for ( ; p < ep ; p++ )
> @@ -275,7 +276,7 @@ stream_cnt( void )
>  	size_t ixcnt;
>  	size_t bitix;
>  
> -	ASSERT( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
> +	assert( sizeof( ixmap ) * NBBY >= STREAM_SIMMAX );
>  	
>  	lock();
>  	for ( ; p < ep ; p++ ) {
> diff --git a/common/util.c b/common/util.c
> index 73f18fe..1dc6d6c 100644
> --- a/common/util.c
> +++ b/common/util.c
> @@ -25,6 +25,7 @@
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <dirent.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -46,9 +47,9 @@ write_buf( char *bufp,
>  	while ( bufsz ) {
>  		int rval;
>  
> -		ASSERT( bufsz > 0 );
> +		assert( bufsz > 0 );
>  		mbufp = ( *get_write_buf_funcp )( contextp, bufsz, &mbufsz );
> -		ASSERT( mbufsz <= bufsz );
> +		assert( mbufsz <= bufsz );
>  		if ( bufp ) {
>  			(void)memcpy( ( void * )mbufp, ( void * )bufp, mbufsz );
>  		} else {
> @@ -86,7 +87,7 @@ read_buf( char *bufp,
>  		if ( *statp ) {
>  			break;
>  		}
> -		ASSERT( mbufsz <= bufsz );
> +		assert( mbufsz <= bufsz );
>  		if ( bufp ) {
>  			( void )memcpy( (void *)bufp, (void *)mbufp, mbufsz );
>  			bufp += mbufsz;
> @@ -255,7 +256,7 @@ bigstat_one( intgen_t fsfd,
>          xfs_fsop_bulkreq_t bulkreq;
>  	intgen_t count = 0;
>  
> -	ASSERT( ino > 0 );
> +	assert( ino > 0 );
>          bulkreq.lastip = (__u64 *)&ino;
>          bulkreq.icount = 1;
>          bulkreq.ubuffer = statp;
> @@ -354,13 +355,13 @@ diriter( jdm_fshandle_t *fshandlep,
>  	intgen_t cbrval;
>  
>  	if ( usrgdp ) {
> -		ASSERT( usrgdsz >= sizeof( struct dirent ) );
> +		assert( usrgdsz >= sizeof( struct dirent ) );
>  		gdsz = usrgdsz;
>  		gdp = ( struct dirent * )usrgdp;
>  	} else {
>  		gdsz = pgsz;
>  		gdp = ( struct dirent * )malloc( gdsz );
> -		ASSERT( gdp );
> +		assert( gdp );
>  	}
>  
>  	/* open the directory
> @@ -377,7 +378,7 @@ diriter( jdm_fshandle_t *fshandlep,
>  		}
>  		return -1;
>  	}
> -	ASSERT( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
> +	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
>  
>  	/* lots of buffering done here, to achieve OS-independence.
>  	 * if proves to be to much overhead, can streamline.
> @@ -389,8 +390,8 @@ diriter( jdm_fshandle_t *fshandlep,
>  		intgen_t nread;
>  		register size_t reclen;
>  
> -		ASSERT( scrval == 0 );
> -		ASSERT( cbrval == 0 );
> +		assert( scrval == 0 );
> +		assert( cbrval == 0 );
>  
>  		nread = getdents_wrap( fd, (char *)gdp, gdsz );
>  		
> @@ -421,12 +422,12 @@ diriter( jdm_fshandle_t *fshandlep,
>  		      nread > 0
>  		      ;
>  		      nread -= ( intgen_t )reclen,
> -		      ASSERT( nread >= 0 ),
> +		      assert( nread >= 0 ),
>  		      p = ( struct dirent * )( ( char * )p + reclen ),
>  		      reclen = ( size_t )p->d_reclen ) {
>  			xfs_bstat_t statbuf;
> -			ASSERT( scrval == 0 );
> -			ASSERT( cbrval == 0 );
> +			assert( scrval == 0 );
> +			assert( cbrval == 0 );
>  
>  			/* skip "." and ".."
>  			 */
> @@ -538,7 +539,7 @@ fold_init( fold_t fold, char *infostr, char c )
>  	char *endp;
>  	ix_t cnt;
>  
> -	ASSERT( sizeof( fold_t ) == FOLD_LEN + 1 );
> +	assert( sizeof( fold_t ) == FOLD_LEN + 1 );
>  
>  	infolen = strlen( infostr );
>  	if ( infolen > FOLD_LEN - 4 ) {
> @@ -551,23 +552,23 @@ fold_init( fold_t fold, char *infostr, char c )
>  	p = &fold[ 0 ];
>  	endp = &fold[ sizeof( fold_t ) - 1 ];
>  
> -	ASSERT( p < endp );
> +	assert( p < endp );
>  	*p++ = ' ';
>  	for ( cnt = 0 ; cnt < predashlen && p < endp ; cnt++, p++ ) {
>  		*p = c;
>  	}
> -	ASSERT( p < endp );
> +	assert( p < endp );
>  	*p++ = ' ';
> -	ASSERT( p < endp );
> -	ASSERT( p + infolen < endp );
> +	assert( p < endp );
> +	assert( p + infolen < endp );
>  	strcpy( p, infostr );
>  	p += infolen;
> -	ASSERT( p < endp );
> +	assert( p < endp );
>  	*p++ = ' ';
> -	ASSERT( p < endp );
> +	assert( p < endp );
>  	for ( cnt = 0 ; cnt < postdashlen && p < endp ; cnt++, p++ ) {
>  		*p = c;
>  	}
> -	ASSERT( p <= endp );
> +	assert( p <= endp );
>  	*p = 0;
>  }
> diff --git a/dump/content.c b/dump/content.c
> index 5f7b4d9..3682358 100644
> --- a/dump/content.c
> +++ b/dump/content.c
> @@ -30,6 +30,7 @@
>  #include <sys/ioctl.h>
>  #include <sys/quota.h>
>  #include <malloc.h>
> +#include <assert.h>
>  
>  #ifdef linux
>  #include <xfs/xqm.h>
> @@ -559,18 +560,18 @@ content_init( intgen_t argc,
>  
>  	/* basic sanity checks
>  	 */
> -	ASSERT( sizeof( mode_t ) == MODE_SZ );
> -	ASSERT( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
> -	ASSERT( sizeof( bstat_t ) == BSTAT_SZ );
> -	ASSERT( sizeof( filehdr_t ) == FILEHDR_SZ );
> -	ASSERT( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
> -	ASSERT( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
> -	ASSERT( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
> -	ASSERT( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
> -	ASSERT( sizeofmember( content_hdr_t, ch_specific )
> +	assert( sizeof( mode_t ) == MODE_SZ );
> +	assert( sizeof( timestruct_t ) == TIMESTRUCT_SZ );
> +	assert( sizeof( bstat_t ) == BSTAT_SZ );
> +	assert( sizeof( filehdr_t ) == FILEHDR_SZ );
> +	assert( sizeof( extenthdr_t ) == EXTENTHDR_SZ );
> +	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
> +	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
> +	assert( DIRENTHDR_SZ % DIRENTHDR_ALIGN == 0 );
> +	assert( sizeofmember( content_hdr_t, ch_specific )
>  		>=
>  		sizeof( content_inode_hdr_t ));
> -	ASSERT( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
> +	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
>  
>  	/* calculate offsets of portions of the write hdr template
>  	 */
> @@ -737,20 +738,20 @@ content_init( intgen_t argc,
>  	 */
>  	if ( subtreecnt ) {
>  		subtreep = ( char ** )calloc( subtreecnt, sizeof( char * ));
> -		ASSERT( subtreep );
> +		assert( subtreep );
>  		optind = 1;
>  		opterr = 0;
>  		subtreeix = 0;
>  		while ( ( c = getopt( argc, argv, GETOPT_CMDSTRING )) != EOF ) {
>  			switch ( c ) {
>  			case GETOPT_SUBTREE:
> -				ASSERT( subtreeix < subtreecnt );
> -				ASSERT( optarg && optarg[ 0 ] != '-' );
> +				assert( subtreeix < subtreecnt );
> +				assert( optarg && optarg[ 0 ] != '-' );
>  				subtreep[ subtreeix++ ] = optarg;
>  				break;
>  			}
>  		}
> -		ASSERT( subtreeix == subtreecnt );
> +		assert( subtreeix == subtreecnt );
>  	} else {
>  		subtreep = 0;
>  	}
> @@ -900,7 +901,7 @@ content_init( intgen_t argc,
>  			sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
>  			sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
>  								sizeof( drange_t ));
> -			ASSERT( sc_resumerangep );
> +			assert( sc_resumerangep );
>  			for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
>  				inv_stream_t *bsp;
>  				inv_stream_t *esp;
> @@ -966,7 +967,7 @@ content_init( intgen_t argc,
>  		inv_free_session( &sessp );
>  		sessp = 0;
>  		ok = inv_close( inv_idbt );
> -		ASSERT( ok );
> +		assert( ok );
>  		inv_idbt = INV_TOKEN_NULL;
>  		goto baseuuidbypass;
>  	}
> @@ -1028,7 +1029,7 @@ content_init( intgen_t argc,
>  						   (u_char_t)sc_level,
>  						   &sessp);
>  		ok1 = inv_close( inv_idbt );
> -		ASSERT( ok1 );
> +		assert( ok1 );
>  		if ( ! ok ) {
>  			sessp = 0;
>  		}
> @@ -1046,7 +1047,7 @@ content_init( intgen_t argc,
>  		sc_resumerangecnt =  ( size_t )sessp->s_nstreams;
>  		sc_resumerangep = ( drange_t * )calloc( sc_resumerangecnt,
>  						        sizeof( drange_t ));
> -		ASSERT( sc_resumerangep );
> +		assert( sc_resumerangep );
>  		for ( strmix = 0 ; strmix < sc_resumerangecnt ; strmix++ ) {
>  			inv_stream_t *bsp;
>  			inv_stream_t *esp;
> @@ -1119,8 +1120,8 @@ baseuuidbypass:
>  		samefoundpr = BOOL_FALSE;
>  	}
>  	if ( underfoundpr ) {
> -		ASSERT( underlevel <= LEVEL_MAX );
> -		ASSERT( undertime );
> +		assert( underlevel <= LEVEL_MAX );
> +		assert( undertime );
>  		if ( samefoundpr ) {
>  			if ( undertime >= sametime ) {
>  				if ( underinterruptedpr ) {
> @@ -1157,7 +1158,7 @@ baseuuidbypass:
>  				sc_incrbaselevel = underlevel;
>  				uuid_copy(sc_incrbaseid, underid);
>  				sc_resumepr = BOOL_FALSE;
> -				ASSERT( sc_resumerangep );
> +				assert( sc_resumerangep );
>  				free( ( void * )sc_resumerangep );
>  				sc_resumerangep = 0;
>  			} else {
> @@ -1179,14 +1180,14 @@ baseuuidbypass:
>  					      sc_level,
>  					      sc_level );
>  				}
> -				ASSERT( sametime );
> +				assert( sametime );
>  				sc_incrpr = BOOL_TRUE;
>  				sc_incrbasetime = undertime;
>  				sc_incrbaselevel = underlevel;
>  				sc_resumepr = BOOL_TRUE;
>  				sc_resumebasetime = sametime;
>  				uuid_copy(sc_resumebaseid, sameid);
> -				ASSERT( sc_resumerangep );
> +				assert( sc_resumerangep );
>  			}
>  		} else {
>  			if ( underinterruptedpr ) {
> @@ -1223,11 +1224,11 @@ baseuuidbypass:
>  			sc_incrbaselevel = underlevel;
>  			uuid_copy(sc_incrbaseid, underid);
>  			sc_resumepr = BOOL_FALSE;
> -			ASSERT( ! sc_resumerangep );
> +			assert( ! sc_resumerangep );
>  		}
>  	} else {
>  		if ( samefoundpr ) {
> -			ASSERT( sametime );
> +			assert( sametime );
>  			if ( subtreecnt && ! samepartialpr ) {
>  				mlog( MLOG_NORMAL | MLOG_WARNING, _(
>  				      "level %u "
> @@ -1250,11 +1251,11 @@ baseuuidbypass:
>  			sc_resumepr = BOOL_TRUE;
>  			sc_resumebasetime = sametime;
>  			uuid_copy(sc_resumebaseid, sameid);
> -			ASSERT( sc_resumerangep );
> +			assert( sc_resumerangep );
>  		} else {
>  			sc_incrpr = BOOL_FALSE;
>  			sc_resumepr = BOOL_FALSE;
> -			ASSERT( ! sc_resumerangep );
> +			assert( ! sc_resumerangep );
>  			if ( sc_level > 0 ) {
>  				mlog( MLOG_NORMAL | MLOG_ERROR, _(
>  				      "cannot find earlier dump "
> @@ -1294,9 +1295,9 @@ baseuuidbypass:
>  			char incrtimestr[ 30 ];
>  
>  			strcpy( restimestr, ctimennl( &sc_resumebasetime ));
> -			ASSERT( strlen( restimestr ) < sizeof( restimestr ));
> +			assert( strlen( restimestr ) < sizeof( restimestr ));
>  			strcpy( incrtimestr, ctimennl( &sc_incrbasetime ));
> -			ASSERT( strlen( incrtimestr ) < sizeof( incrtimestr ));
> +			assert( strlen( incrtimestr ) < sizeof( incrtimestr ));
>  
>  			mlog( MLOG_VERBOSE, _(
>  			      "resuming level %d incremental dump of %s:%s "
> @@ -1388,7 +1389,7 @@ baseuuidbypass:
>  		}
>  		sc_rootxfsstatp =
>  			( xfs_bstat_t * )calloc( 1, sizeof( xfs_bstat_t ));
> -		ASSERT( sc_rootxfsstatp );
> +		assert( sc_rootxfsstatp );
>  
>  		if ( bigstat_one( sc_fsfd, rootstat.st_ino, sc_rootxfsstatp) < 0 ) {
>  			mlog( MLOG_ERROR,
> @@ -1433,7 +1434,7 @@ baseuuidbypass:
>  	sc_stat_inomapcnt = ( size64_t )fs_getinocnt( mntpnt );
>  
>  	sc_startptp = ( startpt_t * )calloc( drivecnt, sizeof( startpt_t ));
> -	ASSERT( sc_startptp );
> +	assert( sc_startptp );
>  	ok = inomap_build( sc_fshandlep,
>  			   sc_fsfd,
>  			   sc_rootxfsstatp,
> @@ -1467,7 +1468,7 @@ baseuuidbypass:
>  	 * an inomap for each media file. the dirdump flag will be set
>  	 * in content_stream_dump() for streams which dump the directories.
>  	 */
> -	ASSERT( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
> +	assert( sizeof( cwhdrtemplatep->ch_specific ) >= sizeof( *scwhdrtemplatep ));
>  	scwhdrtemplatep->cih_mediafiletype = CIH_MEDIAFILETYPE_DATA;
>  	scwhdrtemplatep->cih_level = ( int32_t )sc_level;
>  	scwhdrtemplatep->cih_dumpattr = CIH_DUMPATTR_INOMAP;
> @@ -1553,17 +1554,17 @@ baseuuidbypass:
>  	/* allocate and populate per-stream context descriptors
>  	 */
>  	sc_contextp = ( context_t * )calloc( drivecnt, sizeof( context_t ));
> -	ASSERT( sc_contextp );
> +	assert( sc_contextp );
>  	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
>  		context_t *contextp = &sc_contextp[ strmix ];
>  
>  		contextp->cc_filehdrp =
>  				( filehdr_t * )calloc( 1, sizeof( filehdr_t ));
> -		ASSERT( contextp->cc_filehdrp );
> +		assert( contextp->cc_filehdrp );
>  
>  		contextp->cc_extenthdrp =
>  			    ( extenthdr_t * )calloc( 1, sizeof( extenthdr_t ));
> -		ASSERT( contextp->cc_extenthdrp );
> +		assert( contextp->cc_extenthdrp );
>  
>  		contextp->cc_getdentsbufsz = sizeof( struct dirent )
>  					       +
> @@ -1573,7 +1574,7 @@ baseuuidbypass:
>  		}
>  		contextp->cc_getdentsbufp =
>  			   ( char * ) calloc( 1, contextp->cc_getdentsbufsz );
> -		ASSERT( contextp->cc_getdentsbufp );
> +		assert( contextp->cc_getdentsbufp );
>  
>  		contextp->cc_mdirentbufsz = sizeof( direnthdr_t  )
>  					    +
> @@ -1582,7 +1583,7 @@ baseuuidbypass:
>  					    DIRENTHDR_ALIGN;
>  		contextp->cc_mdirentbufp =
>  			   ( char * ) calloc( 1, contextp->cc_mdirentbufsz );
> -		ASSERT( contextp->cc_mdirentbufp );
> +		assert( contextp->cc_mdirentbufp );
>  
>  		contextp->cc_extattrlistbufsz = EXTATTR_LISTBUF_SZ;
>  		contextp->cc_extattrrtrvarraylen = EXTATTR_RTRVARRAY_LEN;
> @@ -1592,15 +1593,15 @@ baseuuidbypass:
>  		}
>  		contextp->cc_extattrlistbufp =
>  			   ( char * )calloc( 1, contextp->cc_extattrlistbufsz );
> -		ASSERT( contextp->cc_extattrlistbufp );
> +		assert( contextp->cc_extattrlistbufp );
>  		contextp->cc_extattrrtrvarrayp =
>  		  ( attr_multiop_t * )calloc( contextp->cc_extattrrtrvarraylen,
>  				    sizeof( attr_multiop_t ));
> -		ASSERT( contextp->cc_extattrrtrvarrayp );
> +		assert( contextp->cc_extattrrtrvarrayp );
>  		contextp->cc_extattrdumpbufp =
>  			   ( char * )memalign( sizeof( extattrhdr_t ),
>  					       contextp->cc_extattrdumpbufsz );
> -		ASSERT( contextp->cc_extattrdumpbufp );
> +		assert( contextp->cc_extattrdumpbufp );
>  		if (hsm_fs_ctxtp) {
>  			contextp->cc_hsm_f_ctxtp = HsmAllocateFileContext(
>  				hsm_fs_ctxtp);
> @@ -1611,7 +1612,7 @@ baseuuidbypass:
>  		contextp->cc_readlinkbufsz = MAXPATHLEN + SYMLINK_ALIGN;
>  		contextp->cc_readlinkbufp =
>  			   ( char * ) calloc( 1, contextp->cc_readlinkbufsz );
> -		ASSERT( contextp->cc_readlinkbufp );
> +		assert( contextp->cc_readlinkbufp );
>  
>  		contextp->cc_inomap_contextp = inomap_alloc_context( );
>  	}
> @@ -1770,7 +1771,7 @@ content_statline( char **linespp[ ] )
>  				 (unsigned long long)sc_stat_inomapdone,
>  				 (unsigned long long)sc_stat_inomapcnt,
>  				 elapsed );
> -			ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
> +			assert( strlen( statline[ 0 ] ) < STATLINESZ );
>  		} else {
>  			sprintf( statline[ 0 ],
>  				 "status at %02d:%02d:%02d: "
> @@ -1784,7 +1785,7 @@ content_statline( char **linespp[ ] )
>  				 (unsigned long long)sc_stat_inomapdone,
>  				 (unsigned long long)sc_stat_inomapcnt,
>  				 elapsed );
> -			ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
> +			assert( strlen( statline[ 0 ] ) < STATLINESZ );
>  		}
>  		return 1;
>  	}
> @@ -1835,7 +1836,7 @@ content_statline( char **linespp[ ] )
>  				elapsed );
>  	}
>  
> -	ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
> +	assert( strlen( statline[ 0 ] ) < STATLINESZ );
>  
>  	/* optionally create stat lines for each drive
>  	 */
> @@ -1883,7 +1884,7 @@ content_statline( char **linespp[ ] )
>  		sprintf( &statline[ statlinecnt ]
>  				  [ strlen( statline[ statlinecnt ] ) ],
>  			 "\n" );
> -		ASSERT( strlen( statline[ statlinecnt ] ) < STATLINESZ );
> +		assert( strlen( statline[ statlinecnt ] ) < STATLINESZ );
>  		statlinecnt++;
>  	}
>  
> @@ -1905,7 +1906,7 @@ create_inv_session(
>  
>  	/* create a cleanup handler to close the inventory on exit. */
>  	rval = atexit( inv_cleanup );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  
>  	sc_inv_idbtoken = inv_open( ( inv_predicate_t )INV_BY_UUID,
>  					INV_SEARCH_N_MOD,
> @@ -1915,12 +1916,12 @@ create_inv_session(
>  	}
>  	qmntpnt = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
>  					+ 1 + strlen( mntpnt ) + 1 );
> -	ASSERT( qmntpnt );
> -	ASSERT( strlen( gwhdrtemplatep->gh_hostname ));
> +	assert( qmntpnt );
> +	assert( strlen( gwhdrtemplatep->gh_hostname ));
>  	sprintf( qmntpnt, "%s:%s", gwhdrtemplatep->gh_hostname, mntpnt );
>  	qfsdevice = ( char * )calloc( 1, strlen( gwhdrtemplatep->gh_hostname )
>  					 + 1 + strlen( fsdevice ) + 1 );
> -	ASSERT( qfsdevice );
> +	assert( qfsdevice );
>  	sprintf( qfsdevice, "%s:%s", gwhdrtemplatep->gh_hostname, fsdevice );
>  
>  	sc_inv_sestoken = inv_writesession_open( sc_inv_idbtoken,
> @@ -1943,7 +1944,7 @@ create_inv_session(
>  	*/
>  	sc_inv_stmtokenp = ( inv_stmtoken_t * )
>  				calloc( drivecnt, sizeof( inv_stmtoken_t ));
> -	ASSERT( sc_inv_stmtokenp );
> +	assert( sc_inv_stmtokenp );
>  	for ( strmix = 0 ; strmix < drivecnt ; strmix++ ) {
>  		drive_t *drivep = drivepp[ strmix ];
>  		char *drvpath;
> @@ -1971,7 +1972,7 @@ mark_set( drive_t *drivep, xfs_ino_t ino, off64_t offset, int32_t flags )
>  {
>  	drive_ops_t *dop = drivep->d_opsp;
>  	mark_t *markp = ( mark_t * )calloc( 1, sizeof( mark_t ));
> -	ASSERT( markp );
> +	assert( markp );
>  
>  	if ( flags & STARTPT_FLAGS_NULL ) {
>  		mlog( MLOG_DEBUG,
> @@ -2102,17 +2103,17 @@ content_stream_dump( ix_t strmix )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( RV_OK == 0 ); /* bigstat_iter depends on this */
> +	assert( RV_OK == 0 ); /* bigstat_iter depends on this */
>  
>  	/* allocate a buffer for use by bstat_iter
>  	 */
>  	bstatbufp = ( xfs_bstat_t * )calloc( bstatbuflen,
>  					     sizeof( xfs_bstat_t ));
> -	ASSERT( bstatbufp );
> +	assert( bstatbufp );
>  
>  	/* allocate an inomap context */
>  	inomap_contextp = inomap_alloc_context();
> -	ASSERT( inomap_contextp );
> +	assert( inomap_contextp );
>  
>  	/* determine if stream terminators will be used and are expected.
>  	 * this will be revised each time a new media file is begun.
> @@ -2253,7 +2254,7 @@ content_stream_dump( ix_t strmix )
>  		if ( rv == RV_CORE ) {
>  			return mlog_exit(EXIT_FAULT, rv);
>  		}
> -		ASSERT( rv == RV_OK );
> +		assert( rv == RV_OK );
>  		if ( rv != RV_OK ) {
>  			return mlog_exit(EXIT_FAULT, rv);
>  		}
> @@ -2298,7 +2299,7 @@ content_stream_dump( ix_t strmix )
>  			free( ( void * )bstatbufp );
>  			return mlog_exit(EXIT_FAULT, rv);
>  		}
> -		ASSERT( rv == RV_OK );
> +		assert( rv == RV_OK );
>  		if ( rv != RV_OK ) {
>  			free( ( void * )bstatbufp );
>  			return mlog_exit(EXIT_FAULT, rv);
> @@ -2334,7 +2335,7 @@ content_stream_dump( ix_t strmix )
>  				free( ( void * )bstatbufp );
>  				return mlog_exit(EXIT_FAULT, rv);
>  			}
> -			ASSERT( rv == RV_OK );
> +			assert( rv == RV_OK );
>  			if ( rv != RV_OK ) {
>  				free( ( void * )bstatbufp );
>  				return mlog_exit(EXIT_FAULT, rv);
> @@ -2394,7 +2395,7 @@ content_stream_dump( ix_t strmix )
>  				free( ( void * )bstatbufp );
>  				return mlog_exit(EXIT_FAULT, rv);
>  			}
> -			ASSERT( rv == RV_OK || rv == RV_NOMORE );
> +			assert( rv == RV_OK || rv == RV_NOMORE );
>  			if ( rv != RV_OK && rv != RV_NOMORE ) {
>  				free( ( void * )bstatbufp );
>  				return mlog_exit(EXIT_FAULT, rv);
> @@ -2737,7 +2738,7 @@ content_mediachange_query( void )
>  	}
>  	nochangeix = choicecnt;
>  	choicestr[ choicecnt++ ] = "continue";
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	responseix = dlog_multi_query( querystr,
>  				       querycnt,
>  				       choicestr,
> @@ -2755,7 +2756,7 @@ content_mediachange_query( void )
>  		clr_mcflag( choicetothrdmap[ responseix ].thrdix );
>  		return "media change acknowledged\n";
>  	}
> -	ASSERT( responseix == nochangeix );
> +	assert( responseix == nochangeix );
>  	return "continuing\n";
>  }
>  
> @@ -2919,7 +2920,7 @@ dump_dir( ix_t strmix,
>  
>  	/* no way this can be non-dir, but check anyway
>  	 */
> -	ASSERT( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
> +	assert( ( statp->bs_mode & S_IFMT ) == S_IFDIR );
>  	if ( ( statp->bs_mode & S_IFMT ) != S_IFDIR ) {
>  		return RV_OK;
>  	}
> @@ -3041,7 +3042,7 @@ dump_dir( ix_t strmix,
>  		      nread > 0
>  		      ;
>  		      nread -= ( intgen_t )reclen,
> -		      ASSERT( nread >= 0 ),
> +		      assert( nread >= 0 ),
>  		      p = ( struct dirent * )( ( char * )p + reclen ),
>  		      reclen = ( size_t )p->d_reclen ) {
>  			xfs_ino_t ino;
> @@ -3056,7 +3057,7 @@ dump_dir( ix_t strmix,
>  			 * be null-terminated, but the record may have
>  			 * padding after the null-termination.
>  			 */
> -			ASSERT( namelen < nameszmax );
> +			assert( namelen < nameszmax );
>  #endif
>  
>  			/* skip "." and ".."
> @@ -3263,7 +3264,7 @@ dump_extattr_list( drive_t *drivep,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( listp->al_count >= 0 );
> +	assert( listp->al_count >= 0 );
>  
>  	/* fill up a retrieve array and build a dump buffer;
>  	 * can run out of entries in the name list, space in the
> @@ -3397,7 +3398,7 @@ dump_extattr_list( drive_t *drivep,
>  		if (dumpbufp <= dumpbufendp)
>  			continue;	/* no buffer overflow yet */
>  
> -		ASSERT( endp > contextp->cc_extattrdumpbufp );
> +		assert( endp > contextp->cc_extattrdumpbufp );
>  		bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
>  
>  		rval = write_buf( contextp->cc_extattrdumpbufp,
> @@ -3476,7 +3477,7 @@ dump_extattr_list( drive_t *drivep,
>  				continue;
>  			}
>  
> -			ASSERT( endp > contextp->cc_extattrdumpbufp );
> +			assert( endp > contextp->cc_extattrdumpbufp );
>  			bufsz = ( size_t )( endp - contextp->cc_extattrdumpbufp );
>  
>  			rval = write_buf( contextp->cc_extattrdumpbufp,
> @@ -3613,7 +3614,7 @@ dump_extattr_buildrecord( xfs_bstat_t *statp,
>  
>  	memset( ( void * )&tmpah, 0, sizeof( tmpah ));
>  	tmpah.ah_sz = recsz;
> -	ASSERT( EXTATTRHDR_SZ + namesz < UINT16MAX );
> +	assert( EXTATTRHDR_SZ + namesz < UINT16MAX );
>  	tmpah.ah_valoff = ( u_int16_t )( EXTATTRHDR_SZ + namesz );
>  	tmpah.ah_flags = ( u_int16_t )
>  		(( flag & ATTR_ROOT ) ? EXTATTRHDR_FLAGS_ROOT :
> @@ -3644,7 +3645,7 @@ dump_extattrhdr( drive_t *drivep,
>  
>  	memset( ( void * )&ahdr, 0, sizeof( ahdr ));
>  	ahdr.ah_sz = recsz;
> -	ASSERT( valoff < UINT16MAX );
> +	assert( valoff < UINT16MAX );
>  	ahdr.ah_valoff = ( u_int16_t )valoff;
>  	ahdr.ah_flags = ( u_int16_t )flags | EXTATTRHDR_FLAGS_CHECKSUM;
>  	ahdr.ah_valsz = valsz;
> @@ -3937,7 +3938,7 @@ dump_file_reg( drive_t *drivep,
>  	 */
>  	if ( statp->bs_ino == startptp->sp_ino ) {
>  		offset = startptp->sp_offset;
> -		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
> +		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
>  	} else {
>  		offset = 0;
>  	}
> @@ -3966,7 +3967,7 @@ dump_file_reg( drive_t *drivep,
>  				break;
>  			}
>  		}
> -		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
> +		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
>  	}
>  		
>  	/* determine the offset within the file where the dump should end.
> @@ -4034,7 +4035,7 @@ dump_file_reg( drive_t *drivep,
>  		/* see if we are done.
>  		 */
>  		if ( cmpltflg ) {
> -			ASSERT( rv == RV_OK );
> +			assert( rv == RV_OK );
>  			break;
>  		}
>  
> @@ -4094,7 +4095,7 @@ dump_file_reg( drive_t *drivep,
>  					&offset,
>  					&bc,
>  					&cmpltflg );
> -		ASSERT( bc >= 0 );
> +		assert( bc >= 0 );
>  		bytecnt += bc;
>  		if ( rv != RV_OK ) {
>  			break;
> @@ -4193,7 +4194,7 @@ dump_file_spec( drive_t *drivep,
>  
>  		/* null-terminate the string
>  		 */
> -		ASSERT( ( size_t )nread < contextp->cc_readlinkbufsz );
> +		assert( ( size_t )nread < contextp->cc_readlinkbufsz );
>  		contextp->cc_readlinkbufp[ nread ] = 0;
>  
>  		/* calculate the extent size - be sure to include room
> @@ -4202,7 +4203,7 @@ dump_file_spec( drive_t *drivep,
>  		extentsz = ( ( size_t )nread + 1 + ( SYMLINK_ALIGN - 1 ))
>  			   &
>  			   ~ ( SYMLINK_ALIGN - 1 );
> -		ASSERT( extentsz <= contextp->cc_readlinkbufsz );
> +		assert( extentsz <= contextp->cc_readlinkbufsz );
>  
>  		/* dump an extent header
>  		 */
> @@ -4351,7 +4352,7 @@ dump_extent_group( drive_t *drivep,
>  	 */
>  	nextoffset = *nextoffsetp;
>  	bytecnt = 0;
> -	ASSERT( ( nextoffset & ( BBSIZE - 1 )) == 0 );
> +	assert( ( nextoffset & ( BBSIZE - 1 )) == 0 );
>  
>  	for ( ; ; ) {
>  		off64_t offset;
> @@ -4398,7 +4399,7 @@ dump_extent_group( drive_t *drivep,
>  		if ( gcp->eg_nextbmapp >= gcp->eg_endbmapp ) {
>  			intgen_t entrycnt; /* entries in new bmap */
>  
> -			ASSERT( gcp->eg_nextbmapp == gcp->eg_endbmapp );
> +			assert( gcp->eg_nextbmapp == gcp->eg_endbmapp );
>  
>  			/* get a new extent block
>  			 */
> @@ -4613,7 +4614,7 @@ dump_extent_group( drive_t *drivep,
>  			      extsz,
>  			      nextoffset );
>  		}
> -		ASSERT( extsz > 0 );
> +		assert( extsz > 0 );
>  
>  		/* if the resultant extent would put us over maxcnt,
>  		 * shorten it, and round up to the next BBSIZE (round 
> @@ -4692,8 +4693,8 @@ dump_extent_group( drive_t *drivep,
>  		 */
>  		if ( sosig && ( extsz > stopoffset - offset )) {
>  			extsz = stopoffset - offset;
> -			ASSERT( extsz >= 0 );
> -			ASSERT( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
> +			assert( extsz >= 0 );
> +			assert( ! ( extsz & ( off64_t )( BBSIZE - 1 )));
>  			mlog( MLOG_NITTY,
>  			      "adjusted top of extent "
>  			      "to adhere to stop offset: "
> @@ -4747,8 +4748,8 @@ dump_extent_group( drive_t *drivep,
>  		}
>  		/* adjust the next offset
>  		 */
> -		ASSERT( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
> -		ASSERT( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
> +		assert( ( offset & ( off64_t )( BBSIZE - 1 )) == 0 );
> +		assert( ( extsz & ( off64_t )( BBSIZE - 1 )) == 0 );
>  		nextoffset = offset + extsz;
>  
>  		/* dump the extent header
> @@ -4786,7 +4787,7 @@ dump_extent_group( drive_t *drivep,
>  			bufp = ( * dop->do_get_write_buf )( drivep,
>  							    reqsz,
>  							    &actualsz );
> -			ASSERT( actualsz <= reqsz );
> +			assert( actualsz <= reqsz );
>  			new_off = lseek64( gcp->eg_fd, offset, SEEK_SET );
>  			if ( new_off == ( off64_t )( -1 )) {
>  				mlog( MLOG_NORMAL, _(
> @@ -4810,7 +4811,7 @@ dump_extent_group( drive_t *drivep,
>  
>  				nread = 0;
>  			}
> -			ASSERT( ( size_t )nread <= actualsz );
> +			assert( ( size_t )nread <= actualsz );
>  			mlog( MLOG_NITTY,
>  			      "read ino %llu offset %lld sz %d actual %d\n",
>  			      statp->bs_ino,
> @@ -5103,8 +5104,8 @@ dump_dirent( drive_t *drivep,
>  		return RV_OK;
>  	}
>  
> -	ASSERT( sz <= UINT16MAX );
> -	ASSERT( sz >= DIRENTHDR_SZ );
> +	assert( sz <= UINT16MAX );
> +	assert( sz >= DIRENTHDR_SZ );
>  
>  	outbufp = malloc(sz);
>  
> @@ -5206,7 +5207,7 @@ dump_session_inv( drive_t *drivep,
>  		      "unable to get session inventory to dump\n") );
>  		return BOOL_TRUE;
>  	}
> -	ASSERT( inv_sbufp );
> +	assert( inv_sbufp );
>  
>  	/* modify the write header to indicate the media file type.
>  	 */
> @@ -5497,18 +5498,18 @@ inv_cleanup( void )
>  			      interrupted ? ": interrupted" : "" );
>  			if (interrupted) mlog_exit_hint(RV_INTR);
>  			ok = inv_stream_close( *inv_stmtp, interrupted );
> -			ASSERT( ok );
> +			assert( ok );
>  		}
>  	}
>  
>  	if ( sc_inv_sestoken != INV_TOKEN_NULL ) {
>  		ok = inv_writesession_close( sc_inv_sestoken );
> -		ASSERT( ok );
> +		assert( ok );
>  	}
>  
>  	if ( sc_inv_idbtoken != INV_TOKEN_NULL ) {
>  		ok = inv_close( sc_inv_idbtoken );
> -		ASSERT( ok );
> +		assert( ok );
>  	}
>  }
>  
> @@ -5542,7 +5543,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( BES_INIT == 0 );
> +	assert( BES_INIT == 0 );
>  
>  	mlog( MLOG_DEBUG | MLOG_MEDIA,
>  	      "Media op: begin media file\n" );
> @@ -5588,7 +5589,7 @@ Media_mfile_begin( drive_t *drivep, context_t *contextp, bool_t intr_allowed )
>  			mediawrittentopr = BOOL_TRUE;
>  			goto changemedia;
>  		default:
> -			ASSERT( 0 );
> +			assert( 0 );
>  			return RV_CORE;
>  		}
>  	}
> @@ -5685,11 +5686,11 @@ position:
>  				intgen_t status;
>  				mlog( MLOG_VERBOSE | MLOG_MEDIA, _(
>  				      "stream terminator found\n") );
> -				ASSERT( contextp->cc_Media_useterminatorpr );
> -				ASSERT( dcaps & DRIVE_CAP_BSF ); /* redundant */
> +				assert( contextp->cc_Media_useterminatorpr );
> +				assert( dcaps & DRIVE_CAP_BSF ); /* redundant */
>  				status = 0;
>  				rval = ( * dop->do_bsf )( drivep, 0, &status );
> -				ASSERT( rval == 0 );
> +				assert( rval == 0 );
>  				if ( status == DRIVE_ERROR_DEVICE ) {
>  					mlog( MLOG_NORMAL | MLOG_ERROR | MLOG_MEDIA, _(
>  					      "encountered media error "
> @@ -5742,10 +5743,10 @@ position:
>  				intgen_t status;
>  				mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_MEDIA, _(
>  				      "repositioning to overwrite\n") );
> -				ASSERT( dcaps & DRIVE_CAP_BSF );
> +				assert( dcaps & DRIVE_CAP_BSF );
>  				status = 0;
>  				rval = ( * dop->do_bsf )( drivep, 0, &status );
> -				ASSERT( rval == 0 );
> +				assert( rval == 0 );
>  				if ( status == DRIVE_ERROR_DEVICE ) {
>  					return RV_DRIVE;
>  				}
> @@ -5881,7 +5882,7 @@ position:
>  				assert( dcaps & DRIVE_CAP_BSF );
>  				status = 0;
>  				rval = ( * dop->do_bsf )( drivep, 0, &status );
> -				ASSERT( rval == 0 );
> +				assert( rval == 0 );
>  				if ( status == DRIVE_ERROR_DEVICE ) {
>  					return RV_DRIVE;
>  				}
> @@ -5923,7 +5924,7 @@ changemedia:
>  	
>  	/* first eject the current media object if capability supported
>  	 */
> -	ASSERT( mediapresentpr != BOOL_UNKNOWN );
> +	assert( mediapresentpr != BOOL_UNKNOWN );
>  	if ( mediapresentpr == BOOL_TRUE ) {
>  		if ( dcaps & DRIVE_CAP_EJECT ) {
>  			rval = ( * dop->do_eject_media )( drivep );
> @@ -5949,7 +5950,7 @@ changemedia:
>  	 */
>  	if ( drivecnt > 1 && ! stdoutpiped ) {
>  		ix_t thrdix = drivep->d_index;
> -		ASSERT( sistr );
> +		assert( sistr );
>  		mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
>  		      "please change media: "
>  		      "type %s to confirm media change\n"),
> @@ -5983,8 +5984,8 @@ changemedia:
>  	goto position;
>  
>  write:
> -	ASSERT( mediapresentpr == BOOL_TRUE );
> -	ASSERT( virginmediapr != BOOL_UNKNOWN );
> +	assert( mediapresentpr == BOOL_TRUE );
> +	assert( virginmediapr != BOOL_UNKNOWN );
>  
>  	if ( intr_allowed && cldmgr_stop_requested( )) {
>  		return RV_INTR;
> @@ -6024,8 +6025,8 @@ write:
>  		mwhdrp->mh_mediaix++; /* pre-initialized to -1 */
>  	}
>  
> -	ASSERT( mwhdrp->mh_mediaix != ( u_int32_t )( -1 ));
> -	ASSERT( mwhdrp->mh_dumpfileix != ( u_int32_t )( -1 ));
> +	assert( mwhdrp->mh_mediaix != ( u_int32_t )( -1 ));
> +	assert( mwhdrp->mh_dumpfileix != ( u_int32_t )( -1 ));
>  
>  	/* do not allow interleaving of media files from different xfsdumps.
>  	 */
> @@ -6090,7 +6091,7 @@ write:
>  				}
>  			}
>  		} else {
> -			ASSERT( ! virginmediapr );
> +			assert( ! virginmediapr );
>  			uuid_copy(mwhdrp->mh_mediaid, mrhdrp->mh_mediaid);
>  			( void )strncpyterm( mwhdrp->mh_medialabel,
>  					     mrhdrp->mh_medialabel,
> @@ -6139,14 +6140,14 @@ Media_mfile_end( drive_t *drivep,
>  	mlog( MLOG_DEBUG | MLOG_MEDIA,
>  	      "Media op: end media file\n" );
>  
> -	ASSERT( contextp->cc_Media_begin_entrystate == BES_INVAL );
> +	assert( contextp->cc_Media_begin_entrystate == BES_INVAL );
>  
>  	/* call drive's end_write op to flush the tail of the media file
>  	 * if has previously hit EOM, this is moot.
>  	 */
>  	rval = ( dop->do_end_write )( drivep, ncommittedp );
>  	if ( hit_eom ) {
> -		ASSERT( ! rval );
> +		assert( ! rval );
>  		contextp->cc_Media_begin_entrystate = BES_ENDEOM;
>  		return RV_EOM;
>  	}
> @@ -6198,7 +6199,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* query: ask if overwrite ok
> @@ -6209,13 +6210,13 @@ retry:
>  		 (unsigned int)drivep->d_index );
>  	querycnt = 0;
>  	querystr[ querycnt++ ] = question;
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	dontix = choicecnt;
>  	choicestr[ choicecnt++ ] = "don't overwrite";
>  	doix = choicecnt;
>  	choicestr[ choicecnt++ ] = "overwrite";
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	sigintix = IXMAX - 1;
>  
>  	responseix = dlog_multi_query( querystr,
> @@ -6239,7 +6240,7 @@ retry:
>  	} else {
>  		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
>  	}
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_multi_ack( ackstr,
>  			ackcnt );
>  
> @@ -6248,7 +6249,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> @@ -6336,7 +6337,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* query: ask if overwrite ok
> @@ -6350,13 +6351,13 @@ retry:
>  		 (unsigned int)drivep->d_index );
>  	querycnt = 0;
>  	querystr[ querycnt++ ] = question;
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	dontix = choicecnt;
>  	choicestr[ choicecnt++ ] = "don't erase";
>  	doix = choicecnt;
>  	choicestr[ choicecnt++ ] = "erase";
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	sigintix = IXMAX - 1;
>  
>  	responseix = dlog_multi_query( querystr,
> @@ -6380,7 +6381,7 @@ retry:
>  	} else {
>  		ackstr[ ackcnt++ ] = "keyboard interrupt\n";
>  	}
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_multi_ack( ackstr,
>  			ackcnt );
>  
> @@ -6389,7 +6390,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> @@ -6448,7 +6449,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	responseix = dlog_string_query( Media_prompt_label_cb,
> @@ -6474,7 +6475,7 @@ retry:
>  		ackstr[ ackcnt++ ] = "abort\n";
>  	}
>  
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_string_ack( ackstr,
>  			 ackcnt );
>  
> @@ -6483,7 +6484,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> diff --git a/dump/inomap.c b/dump/inomap.c
> index a35059a..7a3069f 100644
> --- a/dump/inomap.c
> +++ b/dump/inomap.c
> @@ -25,6 +25,7 @@
>  #include <time.h>
>  #include <fcntl.h>
>  #include <sys/ioctl.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -185,7 +186,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
>  					       bstatbuflen
>  					       *
>  					       sizeof( xfs_bstat_t ));
> -	ASSERT( bstatbufp );
> +	assert( bstatbufp );
>  
>  	/* count the number of inode groups, which will serve as a
>  	 * starting point for the size of the inomap.
> @@ -369,7 +370,7 @@ inomap_build( jdm_fshandle_t *fshandlep,
>  			} else {
>  				ep = &startptp[ startptix + 1 ];
>  			}
> -			ASSERT( ! p->sp_flags );
> +			assert( ! p->sp_flags );
>  			mlog( MLOG_VERBOSE | MLOG_INOMAP,
>  			      _("stream %u: ino %llu offset %lld to "),
>  			      startptix,
> @@ -606,8 +607,8 @@ cb_add( void *arg1,
>  			cb_hdrsz += ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
>  		}
>  	} else if ( resumed ) {
> -		ASSERT( mode != S_IFDIR );
> -		ASSERT( changed );
> +		assert( mode != S_IFDIR );
> +		assert( changed );
>  	} else {
>  		if ( mode == S_IFDIR ) {
>  			if ( cb_skip_unchanged_dirs ) {
> @@ -832,7 +833,7 @@ cb_startpt( void *arg1,
>  		return 0;
>  	}
>  
> -	ASSERT( cb_startptix < cb_startptcnt );
> +	assert( cb_startptix < cb_startptcnt );
>  
>  	estimate = estimate_dump_space( statp );
>  	cb_accum += estimate + ( EXTENTHDR_SZ * (statp->bs_extents + 1) );
> @@ -929,7 +930,7 @@ cb_startpt( void *arg1,
>  			}
>  			break;
>  		default:
> -			ASSERT( 0 );
> +			assert( 0 );
>  			return 1;
>  		}
>  	} while ( action == ( action_t )BUMP || action == ( action_t )SPLIT );
> @@ -1042,7 +1043,7 @@ SEG_GET_BITS( seg_t *segp, xfs_ino_t ino )
>  static intgen_t
>  inomap_init( intgen_t igrpcnt )
>  {
> -	ASSERT( sizeof( hnk_t ) == HNKSZ );
> +	assert( sizeof( hnk_t ) == HNKSZ );
>  
>  	/* lastseg must be initialized with -1 offsets since
>  	 * no segments have been added yet */
> @@ -1483,7 +1484,7 @@ subtreelist_parse( jdm_fshandle_t *fshandlep,
>  	for ( subtreeix = 0 ; subtreeix < subtreecnt ; subtreeix++ ) {
>  		intgen_t cbrval = 0;
>  		char *currentpath = subtreebuf[ subtreeix ];
> -		ASSERT( *currentpath != '/' );
> +		assert( *currentpath != '/' );
>  		( void )diriter( fshandlep,
>  				 fsfd,
>  				 rootstatp,
> @@ -1669,7 +1670,7 @@ quantity2offset( jdm_fshandle_t *fshandlep, xfs_bstat_t *statp, off64_t qty )
>  		}
>  
>  		if ( bmap[ 0 ].bmv_entries <= 0 ) {
> -			ASSERT( bmap[ 0 ].bmv_entries == 0 );
> +			assert( bmap[ 0 ].bmv_entries == 0 );
>  			( void )close( fd );
>  			return offset_next;
>  		}
> diff --git a/inventory/inv_api.c b/inventory/inv_api.c
> index 65102e6..bd473e9 100644
> --- a/inventory/inv_api.c
> +++ b/inventory/inv_api.c
> @@ -26,6 +26,7 @@
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <sys/stat.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -48,7 +49,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
>  
>  	int index = 0;
>  	
> -	ASSERT ( pred );
> +	assert ( pred );
>  	fd = retval = init_idb ( pred, bywhat, forwhat, &tok );
>  
>  	if ( retval == I_DONE ) 
> @@ -72,7 +73,7 @@ inv_open( inv_predicate_t bywhat, inv_oflag_t forwhat, void *pred )
>  		return INV_TOKEN_NULL;
>  	}
>  
> -	ASSERT ( index > 0 );
> +	assert ( index > 0 );
>  
>  	/* Now we need to make sure that this has enough space */
>  	INVLOCK( stobjfd, LOCK_SH );
> @@ -170,12 +171,12 @@ inv_writesession_open(
>  	inv_sestoken_t	sestok;
>  	inv_oflag_t     forwhat;
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> -	ASSERT ( sesid && fsid && mntpt && devpath );
> +	assert ( tok != INV_TOKEN_NULL );
> +	assert ( sesid && fsid && mntpt && devpath );
>  	forwhat = tok->d_oflag;
>  	fd = tok->d_stobj_fd;
> -	ASSERT ( forwhat != INV_SEARCH_ONLY );
> -	ASSERT ( fd > 0 );
> +	assert ( forwhat != INV_SEARCH_ONLY );
> +	assert ( fd > 0 );
>  
>  	if ( ! ( tok->d_update_flag & FSTAB_UPDATED ) ) {
>  		if ( fstab_put_entry( fsid, mntpt, devpath, forwhat ) < 0 ) {
> @@ -218,7 +219,7 @@ inv_writesession_open(
>  	/* create the writesession, and get ready for the streams to come 
>  	   afterwards */
>  	rval = stobj_create_session( sestok, fd, sescnt, &ses, &hdr );
> -	ASSERT (rval > 0);
> +	assert (rval > 0);
>  
>  
>  	INVLOCK( fd, LOCK_UN );
> @@ -256,7 +257,7 @@ inv_writesession_close( inv_sestoken_t tok )
>  {
>  	int		rval;
>  	
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  
>  	/* now update end_time in the inv index header */
>  	rval = idx_put_sesstime( tok, INVT_ENDTIME );
> @@ -287,7 +288,7 @@ inv_stream_open(
>  	int fd;
>  	bool_t err = BOOL_FALSE;
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> +	assert ( tok != INV_TOKEN_NULL );
>  	 
>  	/* this memset is needed as a dump interrupted/crashed very soon
>  	 * after starting results in an inventory with exteremely large
> @@ -446,9 +447,9 @@ inv_put_mediafile(
>  	int 		 rval;
>  
>  
> -	ASSERT ( tok != INV_TOKEN_NULL );
> -	ASSERT ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
> -	ASSERT ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
> +	assert ( tok != INV_TOKEN_NULL );
> +	assert ( tok->md_sesstok->sd_invtok->d_update_flag & FSTAB_UPDATED );
> +	assert ( tok->md_sesstok->sd_invtok->d_stobj_fd >= 0 );
>  
>  	mf = (invt_mediafile_t *) calloc( 1, sizeof( invt_mediafile_t ) );
>  	
> @@ -512,8 +513,8 @@ inv_get_sessioninfo(
>  	int		fd;
>  
>  
> -	ASSERT( tok != INV_TOKEN_NULL );
> -	ASSERT( tok->sd_invtok );
> +	assert( tok != INV_TOKEN_NULL );
> +	assert( tok->sd_invtok );
>  	*bufpp = NULL;
>  	*bufszp = 0;
>  	fd = tok->sd_invtok->d_stobj_fd;
> @@ -579,8 +580,8 @@ inv_free_session(
>  {
>  	uint i;
>  	
> -	ASSERT(ses);
> -	ASSERT(*ses);
> +	assert(ses);
> +	assert(*ses);
>  
>  	for ( i = 0; i < (*ses)->s_nstreams; i++ ) {
>  		/* the array of mediafiles is contiguous */
> diff --git a/inventory/inv_core.c b/inventory/inv_core.c
> index 3f7edb6..a83e7ef 100644
> --- a/inventory/inv_core.c
> +++ b/inventory/inv_core.c
> @@ -25,6 +25,7 @@
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <sys/dir.h>
> +#include <assert.h>
>  #include "types.h"
>  #include "inv_priv.h"
>  
> @@ -44,7 +45,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
>  {
>  	/* object must be locked at least SHARED by caller */
>  	u_int num;
> -	ASSERT( cntsz >= sizeof( invt_counter_t ) );
> +	assert( cntsz >= sizeof( invt_counter_t ) );
>  
>  	*cntpp =  calloc( 1, cntsz);
>  
> @@ -62,7 +63,7 @@ get_counters( int fd, void **cntpp, size_t cntsz )
>  		      "INV : Unknown version %d - Expected version %d\n"),
>  		      (int) ( (invt_counter_t *)(*cntpp))->ic_vernum,
>  		      (int) INV_VERSION );
> -		ASSERT ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
> +		assert ( ((invt_counter_t *)(*cntpp))->ic_vernum ==
>  			INV_VERSION );
>  	} 
>  
> @@ -110,7 +111,7 @@ get_invtrecord( int fd, void *buf, size_t bufsz, off64_t off,
>  {
>  	int  nread;
>  	
> -	ASSERT ( fd >= 0 );
> +	assert ( fd >= 0 );
>  	
>  	if ( dolock ) 
>  		INVLOCK( fd, LOCK_SH );
> diff --git a/inventory/inv_files.c b/inventory/inv_files.c
> index f77eeec..34b7aac 100644
> --- a/inventory/inv_files.c
> +++ b/inventory/inv_files.c
> @@ -23,6 +23,7 @@
>  #include <errno.h>
>  #include <sys/stat.h>
>  #include <sys/dir.h>
> +#include <assert.h>
>  
>  
>  /*----------------------------------------------------------------------*/
> @@ -50,28 +51,28 @@ static char inv_lockfilep[MGR_PATH_MAX];
>  char *
>  inv_dirpath( void )
>  {
> -	ASSERT(inv_base);
> +	assert(inv_base);
>  	return inv_dirpathp;
>  }
>  
>  char *
>  inv_fstab( void )
>  {
> -	ASSERT(inv_base);
> +	assert(inv_base);
>  	return inv_fstabp;
>  }
>  
>  char *
>  inv_lockfile( void )
>  {
> -	ASSERT(inv_base);
> +	assert(inv_base);
>  	return inv_lockfilep;
>  }
>  
>  char *
>  inv_basepath( void )
>  {
> -	ASSERT(inv_base);
> +	assert(inv_base);
>  	return inv_base;
>  }
>  
> diff --git a/inventory/inv_fstab.c b/inventory/inv_fstab.c
> index 6567846..e87152f 100644
> --- a/inventory/inv_fstab.c
> +++ b/inventory/inv_fstab.c
> @@ -25,6 +25,7 @@
>  #include <errno.h>
>  #include <fcntl.h>
>  #include <sys/dir.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -88,7 +89,7 @@ fstab_put_entry( uuid_t *fsidp, char *mntpt, char *dev, inv_oflag_t forwhat )
>  	invt_fstab_t *arr;
>  	int rval = 1;
>  
> -	ASSERT( forwhat != INV_SEARCH_ONLY );
> +	assert( forwhat != INV_SEARCH_ONLY );
>  
>  	/* fd is locked on succesful return */
>  	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
> @@ -229,7 +230,7 @@ fstab_get_fname( void *pred,
>  	if ( bywhat != INV_BY_UUID ) 
>  		free ( arr );
>  
> -	ASSERT( (int) strlen( fname ) < INV_STRLEN );
> +	assert( (int) strlen( fname ) < INV_STRLEN );
>  	return 1;
>  }	
>  	
> diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
> index 145745a..edb72b3 100644
> --- a/inventory/inv_idx.c
> +++ b/inventory/inv_idx.c
> @@ -25,6 +25,7 @@
>  #include <sys/file.h>
>  #include <sys/stat.h>
>  #include <sys/dir.h>
> +#include <assert.h>
>  #include "types.h"
>  #include "mlog.h"
>  #include "inv_priv.h"
> @@ -119,7 +120,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
>  				   We choose the former. */
>  				
>  				/* the timeperiods had better not overlap */
> -				ASSERT(( tm > iarr[i].ie_timeperiod.tp_end ) &&
> +				assert(( tm > iarr[i].ie_timeperiod.tp_end ) &&
>  				       ( tm < iarr[i+1].ie_timeperiod.tp_start ));
>  
>  				/* shift everything from (i+1) onwards by 
> @@ -134,7 +135,7 @@ idx_insert_newentry( int fd, /* kept locked EX by caller */
>  	}		
>  
>  	/* We couldnt find anything that fits */
> -	ASSERT( 0 );	/* We can't get here ! */
> +	assert( 0 );	/* We can't get here ! */
>  	return -1;
>  
>  	
> @@ -255,7 +256,7 @@ idx_create( char *fname, inv_oflag_t forwhat )
>  
>  	/* This is not to be called when the user wants to open
>  	   the db for SEARCH_ONLY. */
> -	ASSERT( forwhat != INV_SEARCH_ONLY );
> +	assert( forwhat != INV_SEARCH_ONLY );
>  
>  	if ((fd = open ( fname , INV_OFLAG(forwhat) | O_CREAT, S_IRUSR|S_IWUSR ) ) < 0 ) {
>  		INV_PERROR ( fname );
> @@ -477,8 +478,8 @@ idx_get_stobj( int invfd, inv_oflag_t forwhat, int *index )
>  		return -1;
>  	/* at this point we know that there should be at least one invindex
>  	   entry present */
> -	ASSERT ( ent != NULL );	
> -	ASSERT ( ent->ie_filename );
> +	assert ( ent != NULL );	
> +	assert ( ent->ie_filename );
>  
>  	fd = open( ent->ie_filename, INV_OFLAG(forwhat) );
>  	if ( fd < 0 )
> diff --git a/inventory/inv_mgr.c b/inventory/inv_mgr.c
> index 1f4a425..926b4c8 100644
> --- a/inventory/inv_mgr.c
> +++ b/inventory/inv_mgr.c
> @@ -24,6 +24,7 @@
>  #include <errno.h>
>  #include <sys/stat.h>
>  #include <sys/dir.h>
> +#include <assert.h>
>  #include "types.h"
>  #include "mlog.h"
>  #include "inv_priv.h"
> @@ -150,7 +151,7 @@ invmgr_query_all_sessions (
>  
>  	/* if on return, this is still null, the search failed */
>  	*outarg = NULL; 
> -	ASSERT(inarg);
> +	assert(inarg);
>  
>  	fd = fstab_getall( &arr, &cnt, &numfs, forwhat );
>  	/* special case missing file: ok, outarg says zero */
> @@ -725,7 +726,7 @@ bool_t
>  invmgr_trylock( invt_mode_t mode )
>  {
>  	int md;
> -	ASSERT( invlock_fd >= 0 );
> +	assert( invlock_fd >= 0 );
>  	
>  	md = (mode == INVT_RECONSTRUCT) ? LOCK_EX: LOCK_SH;
>  
> @@ -738,7 +739,7 @@ invmgr_trylock( invt_mode_t mode )
>  void
>  invmgr_unlock( void )
>  {
> -	ASSERT( invlock_fd >= 0 );
> +	assert( invlock_fd >= 0 );
>  	
>  	INVLOCK( invlock_fd, LOCK_UN );	
>  
> diff --git a/inventory/inv_oref.c b/inventory/inv_oref.c
> index a124b07..b6cd61d 100644
> --- a/inventory/inv_oref.c
> +++ b/inventory/inv_oref.c
> @@ -18,6 +18,7 @@
>  
>  #include <xfs/xfs.h>
>  #include <xfs/jdm.h>
> +#include <assert.h>
>  
>  #include "inv_priv.h"
>  #include "inv_oref.h"
> @@ -34,8 +35,8 @@ oref_resolve_(
>  	intgen_t rval;
>  
>  	type &= INVT_OTYPE_MASK;
> -	ASSERT(type);
> -	ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> +	assert(type);
> +	assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
>  
>  	switch (type) {
>  	      case INVT_OTYPE_INVIDX:
> @@ -51,7 +52,7 @@ oref_resolve_(
>  		break;
>  
>  	      default:
> -		ASSERT(0);
> +		assert(0);
>  		break;
>  	}
>  	
> @@ -73,12 +74,12 @@ oref_resolve_upto(
>  {
>  	intgen_t rval = INV_OK;
>  
> -	ASSERT (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> -	ASSERT (OREF_ISLOCKED(obj));
> +	assert (OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> +	assert (OREF_ISLOCKED(obj));
>  
>  	/* we arent interested in anything else */
>  	type &= INVT_RES_MASK;
> -	ASSERT(type);
> +	assert(type);
>  
>  	if (type >= INVT_RES_COUNTERS) {
>  		rval = oref_resolve_counters(obj);
> @@ -111,11 +112,11 @@ oref_resolve_entries(
>  	if (OREF_ISRESOLVED(obj, INVT_RES_ENTRIES))
>  		return INV_OK;
>  
> -	ASSERT(! OREF_ISRESOLVED(INVT_OTYPE_STOBJ));
> +	assert(! OREF_ISRESOLVED(INVT_OTYPE_STOBJ));
>  
>  	if (OREF_ISRESOLVED(INVT_OTYPE_INVIDX)) {
>  		invt_entry_t *ent;
> -		ASSERT(OREF_CNT_CURNUM(obj));
> +		assert(OREF_CNT_CURNUM(obj));
>  
>  		if (GET_ENTRIES(obj->fd, &ent, OREF_CNT_CURNUM(obj),
>  				sizeof(invt_entry_t)) < 0){
> @@ -125,7 +126,7 @@ oref_resolve_entries(
>  	}
>  	else {
>  		invt_fstab_t *ent;
> -		ASSERT(OREF_CNT_CURNUM(obj));
> +		assert(OREF_CNT_CURNUM(obj));
>  		if (GET_ENTRIES(obj->fd, &ent, OREF_CNT_CURNUM(obj),
>  				sizeof(invt_fstab_t)) < 0){
>  			return INV_ERR;
> @@ -184,10 +185,10 @@ oref_sync(
>  	intgen_t rval;
>  
>  	type &= INVT_RES_MASK;
> -	ASSERT(type);
> -	ASSERT(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> -	ASSERT(OREF_ISRESOLVED(obj, type));
> -	ASSERT(OREF_ISLOCKED(obj));
> +	assert(type);
> +	assert(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> +	assert(OREF_ISRESOLVED(obj, type));
> +	assert(OREF_ISLOCKED(obj));
>  
>  	switch (type) {
>  	      case INVT_RES_COUNTERS:
> @@ -199,7 +200,7 @@ oref_sync(
>  		break;
>  
>  	      case INVT_RES_ENTRIES:
> -		ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
> +		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
>  
>  		rval = PUT_REC_NOLOCK(obj->fd, 
>  				      OREF_ENTRIES(obj), 
> @@ -209,7 +210,7 @@ oref_sync(
>  		break;
>  
>  	      default:
> -		ASSERT(0);
> +		assert(0);
>  		break;
>  	}
>  	
> @@ -226,13 +227,13 @@ oref_sync_append(
>  	intgen_t rval;
>  
>  	type &= INVT_RES_MASK;
> -	ASSERT(type);
> -	ASSERT(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> -	ASSERT(OREF_ISLOCKED(obj));
> +	assert(type);
> +	assert(OREF_ISRESOLVED(obj, INVT_OTYPE_MASK));
> +	assert(OREF_ISLOCKED(obj));
>  
>  	switch (type) {
>  	      case INVT_RES_ENTRIES:
> -		ASSERT(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
> +		assert(! OREF_ISRESOLVED(obj, INVT_OTYPE_STOBJ));
>  		
>  		rval = PUT_REC_NOLOCK(obj->fd, 
>  				      entry,
> @@ -245,7 +246,7 @@ oref_sync_append(
>  		break;
>  
>  	      default:
> -		ASSERT(0);
> +		assert(0);
>  		break;
>  	}
>  	
> @@ -314,7 +315,7 @@ oref_resolve(
>  	invt_oref_t	*stobj;
>  	int		index;
>  
> -	ASSERT(! OREF_ISRESOLVED(invidx, INVT_OTYPE_MASK));
> +	assert(! OREF_ISRESOLVED(invidx, INVT_OTYPE_MASK));
>  	
>  	OREF_SET_TYPE(invidx, INVT_OTYPE_INVIDX);
>  
> @@ -393,7 +394,7 @@ oref_resolve_child(
>  	int		*index)
>  {
>  	invt_entry_t 	*ent;
> -	ASSERT(OREF_IS_LOCKED(invidx));
> +	assert(OREF_IS_LOCKED(invidx));
>  
>  	if (oref_resolve_upto(invidx, INVT_RES_ENTRIES) == INV_ERR)	
>  		return INV_ERR;
> @@ -402,8 +403,8 @@ oref_resolve_child(
>  	
>  	/* at this point we know that there should be at least one invindex
>  	   entry present */
> -	ASSERT ( ent != NULL );	
> -	ASSERT ( ent->ie_filename );
> +	assert ( ent != NULL );	
> +	assert ( ent->ie_filename );
>  
>  	fd = open( ent->ie_filename, O_RDWR );
>  	if ( fd < 0 ) {
> @@ -462,7 +463,7 @@ oref_resolve_new_stobj(
>  	invt_oref_t	*stobj;
>  	inv_idbtoken_t	tok;
>  
> -	ASSERT(OREF_ISLOCKED(invidx));
> +	assert(OREF_ISLOCKED(invidx));
>  
>  	memset ( &ent, 0, sizeof( ent ) );
>  	stobj = calloc(1, sizeof(invt_oref_t));
> diff --git a/inventory/inv_oref.h b/inventory/inv_oref.h
> index 5f4ed68..2562500 100644
> --- a/inventory/inv_oref.h
> +++ b/inventory/inv_oref.h
> @@ -158,48 +158,48 @@ typedef struct invt_oref {
>          { (oref)->token = tok; }
>  
>  #define OREF_SET_CNT(oref, cnt) \
> -	{ ASSERT (OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
> +	{ assert (OREF_ISRESOLVED(oref, INVT_OTYPE_MASK)); \
>  	  ((oref)->type & INVT_OTYPE_STOBJ) ? \
>  	  (oref)->cu_sescnt = (cnt): (oref)->cu_cnt = (cnt); \
>  	  (oref)->type |= INVT_RES_COUNTERS; }
>  
>  #define OREF_SET_ENTRIES(oref, ents) \
> -        { ASSERT ((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB));\
> -	  ASSERT ((oref)->type & INVT_RES_COUNTERS); \
> +        { assert ((oref)->type & (INVT_OTYPE_INVIDX | INVT_OTYPE_FSTAB));\
> +	  assert ((oref)->type & INVT_RES_COUNTERS); \
>  	  ((oref)->type & INVT_OTYPE_INVIDX) ? \
>  	  (oref)->eu_ent = ents : (oref)->eu_fstabent = ents; \
>  	  (oref)->type |= INVT_RES_ENTRIES; }
>  
>  #define OREF_SET_HDRS(oref, hdrs) \
> -        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
> -	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
> +        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
> +	   assert ((oref)->type & INVT_RES_COUNTERS); \
>  	   (oref)->eu_hdr = hdrs; \
>  	   (oref)->type |= INVT_STOBJ_RES_HDRS; }
>  
>  #define OREF_SET_SESSIONS(oref, ses) \
> -        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
> -	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
> +        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
> +	   assert ((oref)->type & INVT_RES_COUNTERS); \
>  	   (oref)->eu_ses = ses; \
>  	   (oref)->type |= INVT_STOBJ_RES_SESSIONS; }
>  
>  #define OREF_SET_STRMS(oref, strms) \
> -        {  ASSERT ((oref)->type & INVT_OTYPE_STOBJ); \
> -	   ASSERT ((oref)->type & INVT_RES_COUNTERS); \
> +        {  assert ((oref)->type & INVT_OTYPE_STOBJ); \
> +	   assert ((oref)->type & INVT_RES_COUNTERS); \
>  	   (oref)->eu_strm = strms; \
>  	   (oref)->type |= INVT_STOBJ_RES_STRMS; }
>  
>  #define OREF_SET_CHILD(oref, stobjref) \
> -        {  ASSERT (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
> +        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
>  	   (oref)->ku_child = stobjref; \
>  	   (oref)->type |= INVT_RES_CHILD; }
>  
>  #define OREF_SET_PARENT(oref, invidxref) \
> -        {  ASSERT (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
> +        {  assert (! OREF_ISRESOLVED(oref, INVT_RES_KIN)); \
>  	   (oref)->ku_parent = invidxref; \
>  	   (oref)->type |= INVT_RES_PARENT; }
>  
>  #define OREF_UNRESOLVE_CHILD(oref) \
> -        {  ASSERT (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
> +        {  assert (OREF_ISRESOLVED(oref, INVT_RES_CHILD)); \
>  	   close((oref)->ku_child->fd); \
>  	   OREF_DESTROY((oref)->ku_child); \
>  	   (oref)->ku_child = 0; \
> diff --git a/inventory/inv_stobj.c b/inventory/inv_stobj.c
> index becac17..42969b1 100644
> --- a/inventory/inv_stobj.c
> +++ b/inventory/inv_stobj.c
> @@ -26,6 +26,7 @@
>  #include <sys/stat.h>
>  #include <sys/dir.h>
>  #include <sys/mman.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "timeutil.h"
> @@ -168,7 +169,7 @@ stobj_split( invt_idxinfo_t *idx, int fd, invt_sescounter_t *sescnt,
>  	if ( GET_SESHEADERS( fd, &harr, ns ) < 0 )
>  		return -1;
>  	
> -	ASSERT( harr != NULL );
> +	assert( harr != NULL );
>  
>  	if ( ( ix = stobj_find_splitpoint( fd, harr, ns, 
>  				       newsess->seshdr->sh_time ) ) == 0 )
> @@ -390,7 +391,7 @@ stobj_sortheaders( int fd, u_int num )
>  	if ( num < 2 ) return 1;
>  
>  	hdrs = malloc( sz );
> -	ASSERT( hdrs );
> +	assert( hdrs );
>  
>  	if ( GET_REC_NOLOCK( fd, hdrs, sz, STOBJ_OFFSET( 0, 0 ) ) < 0 ) {
>  		free ( hdrs );
> @@ -505,7 +506,7 @@ stobj_makefname( char *fname )
>  	strcat( fname, str );
>  	strcat( fname, INV_STOBJ_PREFIX );
>  
> -	ASSERT( (int) strlen( fname ) < INV_STRLEN );
> +	assert( (int) strlen( fname ) < INV_STRLEN );
>  }
>  
>  
> @@ -571,7 +572,7 @@ stobj_create_session(
>  {
>  	off64_t hoff;
>  	
> -	ASSERT( tok && sescnt && ses && hdr );
> +	assert( tok && sescnt && ses && hdr );
>  
>  	hdr->sh_sess_off = -1;
>  	ses->s_cur_nstreams = 0;
> @@ -759,7 +760,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
>  
>  	/* Now we know how big this entire thing is going to be */
>  	sesbufcp = sesbuf = calloc( 1, sessz );
> -	ASSERT( sesbuf );
> +	assert( sesbuf );
>  
>  	/* Copy everything. Note that we don't bother to adjust the offsets
>  	   either in the seshdr or in the mediafiles, because we don't need
> @@ -801,7 +802,7 @@ stobj_pack_sessinfo( int fd, invt_session_t *ses, invt_seshdr_t *hdr,
>  		for ( j = 0; j < strms[i].st_nmediafiles; 
>  		     j++, 
>  		     off = mf.mf_nextmf ) {
> -			ASSERT( off );
> +			assert( off );
>  			if ( GET_REC_NOLOCK( fd, &mf, 
>  					     sizeof( invt_mediafile_t ),
>  					     off ) <= 0 ) {
> @@ -941,7 +942,7 @@ stobj_delete_mobj(int fd,
>  /*  The prob is that we need to keep track of where we got these mfiles from
>      as we get them, or we wont know how to put them back if they are dirty.
>  */
> -			ASSERT( off );
> +			assert( off );
>  			if ( GET_REC_NOLOCK( fd, mf, 
>  					     sizeof( invt_mediafile_t ),
>  					     off ) <= 0 ) {
> @@ -1005,7 +1006,7 @@ stobj_unpack_sessinfo(
>  	char	         *tmpbuf;
>  	char 		 *p = (char *)bufp;
>  	
> -	ASSERT ( bufp );
> +	assert ( bufp );
>  	
>  	tmpbuf = (char *)malloc(bufsz);
>  
> @@ -1109,7 +1110,7 @@ stobj_unpack_sessinfo(
>  		      (int)( p - (char *) bufp ), (int) bufsz,
>  	      (int) ( sizeof( invt_entry_t ) ) );
>  	}
> -	ASSERT( (size_t) ( p - (char *) bufp ) == bufsz );
> +	assert( (size_t) ( p - (char *) bufp ) == bufsz );
>  	
>  	return BOOL_TRUE;
>  }
> @@ -1238,12 +1239,12 @@ stobj_copy_invsess(int fd,
>  		if (nmf)
>  			ises->s_streams[i].st_mediafiles = calloc( nmf,
>  						    sizeof( inv_mediafile_t ) );
> -		ASSERT( !nmf || ises->s_streams[i].st_mediafiles );
> +		assert( !nmf || ises->s_streams[i].st_mediafiles );
>  
>  		for ( j = 0; j < nmf; 
>  		      j++, 
>  		      off = mf.mf_nextmf ) {
> -			ASSERT( off );
> +			assert( off );
>  			if ( GET_REC_NOLOCK( fd, &mf, 
>  					     sizeof( invt_mediafile_t ),
>  					     off ) <= 0 ) {
> diff --git a/inventory/testmain.c b/inventory/testmain.c
> index cfd0654..d8c61e2 100644
> --- a/inventory/testmain.c
> +++ b/inventory/testmain.c
> @@ -22,6 +22,7 @@
>  #include <sys/file.h>
>  #include <sys/stat.h>
>  #include <fcntl.h>
> +#include <assert.h>
>  #include "types.h"
>  #include "mlog.h"
>  #include "getopt.h"
> @@ -92,12 +93,12 @@ recons_test( int howmany )
>  		rval = get_invtrecord( fd, &sarr[i], 
>  				       sizeof( uuid_t ) + sizeof( size_t ), 0,
>  				       SEEK_CUR, BOOL_FALSE );
> -		ASSERT( rval > 0 );
> -		ASSERT( sarr[i].sz > 0 );
> +		assert( rval > 0 );
> +		assert( sarr[i].sz > 0 );
>  		sarr[i].buf = calloc( 1,  sarr[i].sz );
>  		rval = get_invtrecord( fd, sarr[i].buf,  sarr[i].sz, 0, SEEK_CUR,
>  				       BOOL_FALSE );
> -		ASSERT( rval > 0 );
> +		assert( rval > 0 );
>  	}
>  	
>  	
> @@ -263,9 +264,9 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
>  	printf("first time!\n");
>  	for (i=0; i<8; i++) {
>  		uuid_create( &fsidarr[i], &stat );
> -		ASSERT ( stat == uuid_s_ok );
> +		assert ( stat == uuid_s_ok );
>  		uuid_create( &sesidarr[i], &stat );
> -		ASSERT ( stat == uuid_s_ok );
> +		assert ( stat == uuid_s_ok );
>  	}
>  	fd = open( "uuids", O_RDWR | O_CREAT );
>  	PUT_REC(fd, (void *)fsidarr, sizeof (uuid_t) * 8, 0L );
> @@ -289,7 +290,7 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
>  		dev = dev_str[7];
>  		fsidp = &fsidarr[0]; /* j */
>  		tok1 = inv_open( INV_BY_UUID, INV_SEARCH_N_MOD, fsidp );
> -		ASSERT (tok1 != INV_TOKEN_NULL );
> +		assert (tok1 != INV_TOKEN_NULL );
>  
>  		uuid_create( &labelid, &stat );
>  		uuid_to_string( &labelid, &str, &stat );
> @@ -306,10 +307,10 @@ write_test( int nsess, int nstreams, int nmedia, int dumplevel )
>  					     dumplevel, nstreams, 
>  					     time(NULL),
>  					     mnt, dev );
> -		ASSERT (tok2 != INV_TOKEN_NULL );
> +		assert (tok2 != INV_TOKEN_NULL );
>  		for (m = 0; m<nstreams; m++) {
>  			tok3 = inv_stream_open( tok2,"/dev/rmt");
> -			ASSERT (tok3 != INV_TOKEN_NULL );
> +			assert (tok3 != INV_TOKEN_NULL );
>  
>  			for (k = 0; k<nmedia; k++ )
>  				CREAT_mfiles( tok3, &labelid, k*100,
> @@ -353,7 +354,7 @@ mp_test(int nstreams)
>  {
>  #if 0
>  	tok1 = inv_open( INV_BY_UUID, fsidp );
> -	ASSERT (tok1 != INV_TOKEN_NULL );
> +	assert (tok1 != INV_TOKEN_NULL );
>  
>  	tok2 = inv_writesession_open(tok1, fsidp,
>  				     &labelid,
> @@ -363,11 +364,11 @@ mp_test(int nstreams)
>  				     dumplevel, nstreams, 
>  				     time(NULL),
>  				     mnt, dev );
> -	ASSERT (tok2 != INV_TOKEN_NULL );
> +	assert (tok2 != INV_TOKEN_NULL );
>  
>  	for (m = 0; m<nstreams; m++) {
>  			tok3 = inv_stream_open( tok2,"/dev/rmt");
> -			ASSERT (tok3 != INV_TOKEN_NULL );
> +			assert (tok3 != INV_TOKEN_NULL );
>  
>  			for (k = 0; k<nmedia; k++ )
>  				CREAT_mfiles( tok3, &labelid, k*100,
> @@ -399,7 +400,7 @@ main(int argc, char *argv[])
>  
>  	progname = argv[0];
>  	sesfile = "sessions";
> -	ASSERT( argc > 1 );
> +	assert( argc > 1 );
>  	
>  	mlog_init( argc, argv );
>  
> diff --git a/librmt/rmtioctl.c b/librmt/rmtioctl.c
> index c49e96d..4c108fb 100644
> --- a/librmt/rmtioctl.c
> +++ b/librmt/rmtioctl.c
> @@ -30,6 +30,7 @@
>  #include <sys/ioctl.h>
>  #include <sys/mtio.h>
>  #include <sys/param.h>
> +#include <assert.h>
>  
>  /*
>   * uses old_mtget IRIX structure since we don't bother
> diff --git a/restore/bag.c b/restore/bag.c
> index b7d8fe2..8c7a216 100644
> --- a/restore/bag.c
> +++ b/restore/bag.c
> @@ -22,6 +22,7 @@
>  #include <sys/types.h>
>  #include <stdlib.h>
>  #include <memory.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -33,7 +34,7 @@ bag_alloc( void )
>  	bag_t *bagp;
>  
>  	bagp = ( bag_t * )calloc( 1, sizeof( bag_t ));
> -	ASSERT( bagp );
> +	assert( bagp );
>  	return bagp;
>  }
>  
> @@ -46,9 +47,9 @@ bag_insert( bag_t *bagp,
>  	register bagelem_t *nextp;
>  	register bagelem_t *prevp;
>  
> -	ASSERT( ! newp->be_loaded );
> +	assert( ! newp->be_loaded );
>  	newp->be_loaded = BOOL_TRUE;
> -	ASSERT( ! newp->be_bagp );
> +	assert( ! newp->be_bagp );
>  	newp->be_bagp = bagp;
>  
>  	newp->be_key = key;
> @@ -79,8 +80,8 @@ bag_remove( bag_t *bagp,
>  	register bagelem_t *nextp;
>  	register bagelem_t *prevp;
>  
> -	ASSERT( oldp->be_loaded );
> -	ASSERT( oldp->be_bagp == bagp );
> +	assert( oldp->be_loaded );
> +	assert( oldp->be_bagp == bagp );
>  
>  	nextp = oldp->be_nextp;
>  	prevp = oldp->be_prevp;
> @@ -90,7 +91,7 @@ bag_remove( bag_t *bagp,
>  
>  	if ( bagp->b_headp == oldp ) {
>  		if ( nextp == oldp ) {
> -			ASSERT( prevp == oldp );
> +			assert( prevp == oldp );
>  			bagp->b_headp = 0;
>  		} else {
>  			bagp->b_headp = nextp;
> @@ -121,8 +122,8 @@ bag_find( bag_t *bagp,
>  		*payloadpp = 0;
>  		return 0;
>  	} else {
> -		ASSERT( p->be_loaded );
> -		ASSERT( p->be_bagp == bagp );
> +		assert( p->be_loaded );
> +		assert( p->be_bagp == bagp );
>  		*payloadpp = p->be_payloadp;
>  		return p;
>  	}
> @@ -182,7 +183,7 @@ bag_free( bag_t *bagp )
>  		if ( p == bagp->b_headp ) {
>  			break;
>  		}
> -		ASSERT( p );
> +		assert( p );
>  	}
>  
>  	memset( ( void * )bagp, 0, sizeof( bag_t ));
> diff --git a/restore/content.c b/restore/content.c
> index f2d361b..4796aea 100644
> --- a/restore/content.c
> +++ b/restore/content.c
> @@ -34,6 +34,7 @@
>  #include <utime.h>
>  #include <malloc.h>
>  #include <pthread.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "timeutil.h"
> @@ -912,14 +913,14 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( pers_desc_t ) <= PERS_DESCSZ );
> -	ASSERT( PERS_DESCSZ <= pgsz );
> -	ASSERT( ! ( pgsz % PERS_DESCSZ ));
> -	ASSERT( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
> +	assert( sizeof( pers_desc_t ) <= PERS_DESCSZ );
> +	assert( PERS_DESCSZ <= pgsz );
> +	assert( ! ( pgsz % PERS_DESCSZ ));
> +	assert( sizeof( extattrhdr_t ) == EXTATTRHDR_SZ );
>  
> -	ASSERT( ! ( perssz % pgsz ));
> +	assert( ! ( perssz % pgsz ));
>  
> -	ASSERT( SYNC_INIT == 0 );
> +	assert( SYNC_INIT == 0 );
>  
>  	mlog( MLOG_NITTY,
>  	      "sizeof( pers_desc_t ) == %d, pgsz == %d, perssz == %d \n",
> @@ -928,7 +929,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  	/* allocate transient state
>  	 */
>  	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
> -	ASSERT( tranp );
> +	assert( tranp );
>  
>  	/* allocate a qlock for establishing pi critical regions
>  	 */
> @@ -1208,7 +1209,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  	/* assume all streams contain a directory dump. streams will remove
>  	 * themselves from this bitset if they do not contain a directory dump.
>  	 */
> -	ASSERT( drivecnt <= sizeof(tranp->t_dirdumps) * NBBY );
> +	assert( drivecnt <= sizeof(tranp->t_dirdumps) * NBBY );
>  	tranp->t_dirdumps = ( 1ULL << drivecnt ) - 1;
>  
>  	/* the user may specify stdin as the restore source stream,
> @@ -1329,7 +1330,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  
>  	/* build a full pathname to pers. state file
>  	 */
> -	ASSERT( ! perspath );
> +	assert( ! perspath );
>  	perspath = open_pathalloc( tranp->t_hkdir, persname, 0 );
>  
>  	/* open, creating if non-existent
> @@ -1596,11 +1597,11 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  		intgen_t rval;
>  
>  		path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
> -		ASSERT( path1 );
> +		assert( path1 );
>  		path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
> -		ASSERT( path2 );
> -		ASSERT( persp->a.valpr );
> -		ASSERT( persp->s.valpr );
> +		assert( path2 );
> +		assert( persp->a.valpr );
> +		assert( persp->s.valpr );
>  		rval = chdir( persp->a.dstdir );
>  		if ( rval ) {
>  			mlog( MLOG_NORMAL, _(
> @@ -1673,7 +1674,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  		stpgcnt = persp->a.stpgcnt;
>  		newstpgcnt = stpgcnt;
>  		descpgcnt = persp->s.descpgcnt;
> -		ASSERT( resumepr );
> +		assert( resumepr );
>  		mlog( MLOG_VERBOSE, _(
>  		      "resuming restore previously begun %s\n"),
>  		      ctimennl( &persp->s.begintime ));
> @@ -1683,13 +1684,13 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  	/* unmap temp mapping of hdr, truncate, and remap hdr/subtrees
>  	 */
>  	rval = munmap( ( void * )persp, perssz );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	rval = ftruncate( tranp->t_persfd, ( off_t )perssz
>  					   +
>  					   ( off_t )( stpgcnt + descpgcnt )
>  					   *
>  					   ( off_t )pgsz );
> -	ASSERT( ! rval );
> +	assert( ! rval );
>  	stpgcnt = newstpgcnt;
>  	persp = ( pers_t * ) mmap_autogrow( perssz + stpgcnt * pgsz,
>  				   tranp->t_persfd, 0);
> @@ -1756,7 +1757,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  					+
>  					( STDESCALIGN - 1 );
>  				stdsz &= ~( STDESCALIGN - 1 );
> -				ASSERT( stdsz <= ( size_t )OFFMAX );
> +				assert( stdsz <= ( size_t )OFFMAX );
>  				stdescp->std_nextoff = ( off_t )stdsz;
>  				strcpy( stdescp->std_path, optarg );
>  				stdescp = ( stdesc_t * )
> @@ -1765,7 +1766,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  				break;
>  			}
>  		}
> -		ASSERT( stcnt == 0 );
> +		assert( stcnt == 0 );
>  	}
>  
>  	/* initialize the local extattr abstraction. must be done even if
> @@ -1801,7 +1802,7 @@ content_init( intgen_t argc, char *argv[ ], size64_t vmsz )
>  	 * referenced ONLY via the macros provided; the descriptors will be
>  	 * occasionally remapped, causing the ptr to change.
>  	 */
> -	ASSERT( ! descp );
> +	assert( ! descp );
>  	if ( descpgcnt ) {
>  		descp = ( pers_desc_t * ) mmap_autogrow( descpgcnt * pgsz,
>  						tranp->t_persfd,
> @@ -1932,9 +1933,9 @@ content_stream_restore( ix_t thrdix )
>  	/* allocate two path buffers
>  	 */
>  	path1 = ( char * )calloc( 1, 2 * MAXPATHLEN );
> -	ASSERT( path1 );
> +	assert( path1 );
>  	path2 = ( char * )calloc( 1, 2 * MAXPATHLEN );
> -	ASSERT( path2 );
> +	assert( path2 );
>  
>  	/* set the current directory to dstdir. the tree abstraction
>  	 * depends on the current directory being the root of the
> @@ -2081,7 +2082,7 @@ content_stream_restore( ix_t thrdix )
>  		      "dump found: checking\n" );
>  		matchpr = BOOL_FALSE;
>  		resumepr = ( scrhdrp->cih_dumpattr & CIH_DUMPATTR_RESUME );
> -		ASSERT( scrhdrp->cih_level >= 0 );
> +		assert( scrhdrp->cih_level >= 0 );
>  		level = ( ix_t )scrhdrp->cih_level;
>  		baseidp = resumepr
>  			  ?
> @@ -2246,7 +2247,7 @@ content_stream_restore( ix_t thrdix )
>  			return mlog_exit(EXIT_FAULT, rv);
>  		}
>  		dcaps = drivep->d_capabilities;
> -		ASSERT( fileh != DH_NULL );
> +		assert( fileh != DH_NULL );
>  		lock( );
>  		if ( tranp->t_sync3 == SYNC_BUSY ) {
>  			unlock( );
> @@ -2529,7 +2530,7 @@ content_stream_restore( ix_t thrdix )
>  			return mlog_exit(EXIT_FAULT, rv);
>  		}
>  		dcaps = drivep->d_capabilities;
> -		ASSERT( fileh > DH_NULL );
> +		assert( fileh > DH_NULL );
>  		if ( tranp->t_toconlypr ) {
>  			mlog( MLOG_VERBOSE, _(
>  			      "reading non-directory files\n") );
> @@ -2752,7 +2753,7 @@ content_statline( char **linespp[ ] )
>  			 percent,
>  			 (unsigned long long)tranp->t_direntcnt,
>  			 elapsed );
> -		ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
> +		assert( strlen( statline[ 0 ] ) < STATLINESZ );
>  		
>  		return 1;
>  	}
> @@ -2792,7 +2793,7 @@ content_statline( char **linespp[ ] )
>  		 (unsigned long long)inocnt,
>  		 percent,
>  		 elapsed );
> -	ASSERT( strlen( statline[ 0 ] ) < STATLINESZ );
> +	assert( strlen( statline[ 0 ] ) < STATLINESZ );
>  	
>  	/* return buffer to caller
>  	 */
> @@ -2880,7 +2881,7 @@ content_mediachange_query( void )
>  	}
>  	nochangeix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("continue");
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	responseix = dlog_multi_query( querystr,
>  				       querycnt,
>  				       choicestr,
> @@ -2920,7 +2921,7 @@ content_mediachange_query( void )
>  		choicecnt = 0;
>  		nochangeix = choicecnt;
>  		choicestr[ choicecnt++ ] = _("continue");
> -		ASSERT( choicecnt <= CHOICEMAX );
> +		assert( choicecnt <= CHOICEMAX );
>  		responseix = dlog_multi_query( querystr,
>  					       querycnt,
>  					       choicestr,
> @@ -2936,7 +2937,7 @@ content_mediachange_query( void )
>  					       nochangeix);/* sigquit ix */
>  		return _("continuing\n");
>  	}
> -	ASSERT( responseix == nochangeix );
> +	assert( responseix == nochangeix );
>  	return _("continuing\n");
>  }
>  
> @@ -3106,7 +3107,7 @@ applydirdump( drive_t *drivep,
>  					break;
>  				}
>  				namelen = strlen( dhdrp->dh_name );
> -				ASSERT( namelen <= NAME_MAX );
> +				assert( namelen <= NAME_MAX );
>  
>  				/* add this dirent to the tree.
>  				 */
> @@ -3263,7 +3264,7 @@ eatdirdump( drive_t *drivep,
>  				break;
>  			}
>  			namelen = strlen( dhdrp->dh_name );
> -			ASSERT( namelen <= NAME_MAX );
> +			assert( namelen <= NAME_MAX );
>  		}
>  	}
>  
> @@ -3525,7 +3526,7 @@ applynondirdump( drive_t *drivep,
>  				if ( cur_egrp.eg_ino < next_egrp.eg_ino
>  				     ||
>  				     next_egrp.eg_off > 0 ) {
> -					ASSERT( cur_egrp.eg_ino
> +					assert( cur_egrp.eg_ino
>  						<=
>  						next_egrp.eg_ino );
>  					pi_update_stats( bstatp->bs_blocks
> @@ -3706,8 +3707,8 @@ wipepersstate( void )
>  			       "%s/%s",
>  			       tranp->t_hkdir,
>  			       direntp->d_name );
> -		ASSERT( len > 0 );
> -		ASSERT( len < MAXPATHLEN );
> +		assert( len > 0 );
> +		assert( len < MAXPATHLEN );
>  		( void )unlink( pathname );
>  		closedir( dirp );
>  		dirp = opendir( tranp->t_hkdir );
> @@ -3732,7 +3733,7 @@ Inv_validate_cmdline( void )
>  	bool_t ok;
>  	bool_t rok;
>  
> -	ASSERT( ! persp->s.valpr );
> +	assert( ! persp->s.valpr );
>  
>  	ok = BOOL_FALSE;
>  	sessp = 0;
> @@ -3797,7 +3798,7 @@ Media_create( ix_t thrdix )
>  	Mediap->M_mrhdrp = mrhdrp;
>  	Mediap->M_crhdrp = crhdrp;
>  	Mediap->M_scrhdrp = scrhdrp;
> -	ASSERT( POS_UNKN == 0 );
> +	assert( POS_UNKN == 0 );
>  
>  	return Mediap;
>  }
> @@ -4079,7 +4080,7 @@ Media_mfile_next( Media_t *Mediap,
>  		case DRIVE_ERROR_EOD:
>  			Mediap->M_pos = POS_END;
>  			if ( Mediap->M_fsfixvalpr ) {
> -				ASSERT( purp != PURP_SEARCH );
> +				assert( purp != PURP_SEARCH );
>  				pi_hiteod( Mediap->M_fssix,
>  					   Mediap->M_fsoix );
>  			}
> @@ -4087,7 +4088,7 @@ Media_mfile_next( Media_t *Mediap,
>  		case DRIVE_ERROR_EOM:
>  			Mediap->M_pos = POS_END;
>  			if ( Mediap->M_fsfixvalpr ) {
> -				ASSERT( purp != PURP_SEARCH );
> +				assert( purp != PURP_SEARCH );
>  				pi_hiteom( Mediap->M_fssix,
>  					   Mediap->M_fsoix );
>  			}
> @@ -4206,7 +4207,7 @@ validate:
>  		/* if the purpose is to search, return this media file
>  		 */
>  		if ( purp == PURP_SEARCH ) {
> -			ASSERT( Mediap->M_pos == POS_ATHDR );
> +			assert( Mediap->M_pos == POS_ATHDR );
>  			return RV_OK;
>  		}
>  
> @@ -4457,9 +4458,9 @@ validate:
>  		/* if the purpose is dir, give it to the caller
>  		 */
>  		if ( purp == PURP_DIR ) {
> -			ASSERT( Mediap->M_pos == POS_ATHDR );
> +			assert( Mediap->M_pos == POS_ATHDR );
>  			if ( filehp ) {
> -				ASSERT( fileh != DH_NULL );
> +				assert( fileh != DH_NULL );
>  				*filehp = fileh;
>  			}
>  			return RV_OK;
> @@ -4471,9 +4472,9 @@ validate:
>  
>  		/* see if this media file contains any inodes not yet restored
>  		 */
> -		ASSERT( fileh != DH_NULL );
> +		assert( fileh != DH_NULL );
>  		pi_lock( );
> -		ASSERT( DH2F( fileh )->f_valpr );
> +		assert( DH2F( fileh )->f_valpr );
>  		begino = DH2F( fileh )->f_curegrp.eg_ino;
>  		endino = pi_scanfileendino( fileh );
>  		hassomepr = inomap_rst_needed( begino, endino );
> @@ -4532,8 +4533,8 @@ validate:
>  		 * and no check point, can still get there
>  		 * by doing dummy read of dirdump.
>  		 */
> -		ASSERT( fileh != DH_NULL );
> -		ASSERT( DH2F( fileh )->f_valpr );
> +		assert( fileh != DH_NULL );
> +		assert( DH2F( fileh )->f_valpr );
>  		resumepr = ( ( DH2F( fileh )->f_firstegrp.eg_ino
>  			       !=
>  			       DH2F( fileh )->f_curegrp.eg_ino )
> @@ -4616,7 +4617,7 @@ validate:
>  			rval = 0;
>  			break;
>  		default:
> -		    ASSERT( 0 );
> +		    assert( 0 );
>  		    rval = 1;
>  		    break;
>  		}
> @@ -4634,7 +4635,7 @@ validate:
>  		 */
>  		if ( ! rval ) {
>  			if ( filehp ) {
> -				ASSERT( fileh != DH_NULL );
> +				assert( fileh != DH_NULL );
>  				*filehp = fileh;
>  			}
>  			return RV_OK;
> @@ -4647,7 +4648,7 @@ validate:
>  		( * dop->do_end_read )( drivep );
>  		Mediap->M_pos = POS_UNKN;
>  		fileh = DH_NULL;
> -		ASSERT( purp == PURP_NONDIR );
> +		assert( purp == PURP_NONDIR );
>  		if ( pi_know_no_more_beyond_on_object( purp,
>  						       Mediap->M_fssix,
>  						       Mediap->M_fsoix,
> @@ -4735,7 +4736,7 @@ newmedia:
>  							   BOOL_FALSE );
>  			break;
>  		default:
> -			ASSERT( 0 );
> +			assert( 0 );
>  		}
>  
>  		if ( ! bagp && ! knownholespr && ! maybeholespr ) {
> @@ -4796,7 +4797,7 @@ newmedia:
>  					pi_neededobjs_free( bagp );
>  					bagp = 0;
>  				}
> -				ASSERT( sistr );
> +				assert( sistr );
>  				mlog( MLOG_NORMAL | MLOG_NOTE | MLOG_MEDIA, _(
>  				      "please change media: "
>  				      "type %s to confirm media change\n"),
> @@ -4928,19 +4929,19 @@ pi_allocdesc( dh_t *deschp )
>  		/* first unmap if any existing descriptors
>  		 */
>  		if ( descp ) {
> -			ASSERT( olddescpgcnt > 0 );
> +			assert( olddescpgcnt > 0 );
>  			rval = munmap( ( void * )descp,
>  				       olddescpgcnt * pgsz );
> -			ASSERT( ! rval );
> +			assert( ! rval );
>  			descp = 0;
>  		} else {
> -			ASSERT( olddescpgcnt == 0 );
> +			assert( olddescpgcnt == 0 );
>  		}
>  
>  		/* remap with DAU more pages of descriptors
>  		 */
> -		ASSERT( stpgcnt <= ( ix_t )INTGENMAX );
> -		ASSERT( newdescpgcnt > 0 );
> +		assert( stpgcnt <= ( ix_t )INTGENMAX );
> +		assert( newdescpgcnt > 0 );
>  		descp = ( pers_desc_t * ) mmap_autogrow( newdescpgcnt * pgsz,
>  						tranp->t_persfd,
>  						( off_t )perssz
> @@ -4973,7 +4974,7 @@ pi_allocdesc( dh_t *deschp )
>  	desch = persp->s.descfreeh;
>  	persp->s.descfreeh = DH2D( desch )->d_nexth;
>  	memset( ( void * )DH2D( desch ), 0, sizeof( pers_desc_t ));
> -	ASSERT( desch != DH_NULL );
> +	assert( desch != DH_NULL );
>  	*deschp = desch;
>  	return BOOL_TRUE;
>  }
> @@ -5041,7 +5042,7 @@ pi_insertfile( ix_t drivecnt,
>  	      strmix++,
>  	      strmh = DH2S( strmh )->s_nexth )
>  		;
> -	ASSERT( strmh != DH_NULL );
> +	assert( strmh != DH_NULL );
>  
>  	/* get handle to this object by walking/constructing this stream's
>  	 * object list, up to the desired object
> @@ -5124,10 +5125,10 @@ pi_insertfile( ix_t drivecnt,
>  	     &&
>  	     ! DH2O( prevobjh )->o_lmfknwnpr ) {
>  		size_t prevmfcnt;
> -		ASSERT( DH2O( objh )->o_fmfsix > DH2O( prevobjh )->o_fmfsix );
> +		assert( DH2O( objh )->o_fmfsix > DH2O( prevobjh )->o_fmfsix );
>  		prevmfcnt = DH2O( objh )->o_fmfsix - DH2O( prevobjh )->o_fmfsix;
>  		pi_unlock( );
> -		ASSERT( mediaix > 0 );
> +		assert( mediaix > 0 );
>  		( void )pi_insertfile( drivecnt,
>  				       driveix,
>  				       mediaix - 1,
> @@ -5190,8 +5191,8 @@ pi_insertfile( ix_t drivecnt,
>  	/* update the media file fields not yet valid
>  	 */
>  	if ( egrpvalpr && ! DH2F( fileh )->f_valpr ) {
> -		ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
> -		ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
> +		assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
> +		assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
>  		DH2F( fileh )->f_firstegrp.eg_ino = startino;
>  		DH2F( fileh )->f_firstegrp.eg_off = startoffset;
>  		DH2F( fileh )->f_curegrp = DH2F( fileh )->f_firstegrp;
> @@ -5233,7 +5234,7 @@ pi_addfile( Media_t *Mediap,
>  	if ( ! persp->s.stat_valpr ) {
>  		persp->s.stat_inocnt = scrhdrp->cih_inomap_nondircnt;
>  		persp->s.stat_inodone = 0;
> -		ASSERT( scrhdrp->cih_inomap_datasz <= OFF64MAX );
> +		assert( scrhdrp->cih_inomap_datasz <= OFF64MAX );
>  		persp->s.stat_datacnt = ( off64_t )scrhdrp->cih_inomap_datasz;
>  		persp->s.stat_datadone = 0;
>  		persp->s.stat_valpr = BOOL_TRUE;
> @@ -5301,7 +5302,7 @@ pi_addfile( Media_t *Mediap,
>  		if ( fileh == DH_NULL ) {
>  			return DH_NULL;
>  		}
> -		ASSERT( drhdrp->dh_drivecnt > 0 );
> +		assert( drhdrp->dh_drivecnt > 0 );
>  		if ( drhdrp->dh_driveix < drhdrp->dh_drivecnt - 1 ) {
>  			/* if this is not in the last stream, we know
>  			 * there is at least one other media file in
> @@ -5433,12 +5434,12 @@ pi_addfile( Media_t *Mediap,
>  						  &rval );
>  				switch( rval ) {
>  				case 0:
> -					ASSERT( nread == ( intgen_t )bufszincr );
> +					assert( nread == ( intgen_t )bufszincr );
>  					buflen += ( size_t )nread;
>  					bufsz += bufszincr;
>  					bufp = ( char * )realloc(( void * )bufp,
>  								 bufsz );
> -					ASSERT( bufp );
> +					assert( bufp );
>  					continue;
>  				case DRIVE_ERROR_EOD:
>  				case DRIVE_ERROR_EOF:
> @@ -5495,7 +5496,7 @@ pi_addfile( Media_t *Mediap,
>  		return fileh;
>  	}
>  
> -	ASSERT( 0 );
> +	assert( 0 );
>  	return DH_NULL;
>  }
>  
> @@ -5829,7 +5830,7 @@ pi_scanfileendino( dh_t fileh )
>  	dh_t strmh;
>  	ix_t mode = 0;
>  
> -	ASSERT( fileh != DH_NULL );
> +	assert( fileh != DH_NULL );
>  
>  	/* traverse the pi tree, looking for the next media file after
>  	 */
> @@ -5863,13 +5864,13 @@ pi_scanfileendino( dh_t fileh )
>  			if ( DH2F( nexth )->f_valpr ) {
>  			    xfs_ino_t ino;
>  
> -			    ASSERT( ! ( DH2F( nexth )->f_flags & PF_INV ));
> -			    ASSERT( ! ( DH2F( nexth )->f_flags & PF_TERM ));
> +			    assert( ! ( DH2F( nexth )->f_flags & PF_INV ));
> +			    assert( ! ( DH2F( nexth )->f_flags & PF_TERM ));
>  			    if ( DH2F( nexth )->f_firstegrp.eg_off ) {
>  				ino =  DH2F( nexth )->f_firstegrp.eg_ino;
>  				return ino;
>  			    } else {
> -				ASSERT( DH2F( nexth )->f_firstegrp.eg_ino > 0 );
> +				assert( DH2F( nexth )->f_firstegrp.eg_ino > 0 );
>  				ino =  DH2F( nexth )->f_firstegrp.eg_ino - 1;
>  				return ino;
>  			    }
> @@ -5894,12 +5895,12 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
>  	dh_t follh = DH_NULL;
>  
>  
> -	ASSERT( thisfileh != DH_NULL );
> +	assert( thisfileh != DH_NULL );
>  
>  	/* traverse the pi tree, looking for fileh
>  	 */
>  	pi_lock( );
> -	ASSERT( DH2F( thisfileh )->f_valpr );
> +	assert( DH2F( thisfileh )->f_valpr );
>  
>  	for ( strmh = persp->s.strmheadh
>  	      ;
> @@ -5924,14 +5925,14 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
>  			if ( fileh == thisfileh ) {
>  			    thisfoundpr = BOOL_TRUE;
>  			} else if ( DH2F( fileh )->f_valpr ) {
> -			    ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
> -			    ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
> +			    assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
> +			    assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
>  			    prech = fileh;
>  			}
>  		    } else if ( DH2F( fileh )->f_valpr ) {
> -			ASSERT( ! ( DH2F( fileh )->f_flags & PF_INV ));
> -			ASSERT( ! ( DH2F( fileh )->f_flags & PF_TERM ));
> -			ASSERT( follh == DH_NULL );
> +			assert( ! ( DH2F( fileh )->f_flags & PF_INV ));
> +			assert( ! ( DH2F( fileh )->f_flags & PF_TERM ));
> +			assert( follh == DH_NULL );
>  			follh = fileh;
>  			goto done;
>  		    }
> @@ -5940,7 +5941,7 @@ pi_bracketneededegrps( dh_t thisfileh, egrp_t *first_egrp, egrp_t *next_egrp )
>  	}
>  done:
>  
> -	ASSERT( thisfoundpr );
> +	assert( thisfoundpr );
>  
>  	/* initially the lower bracket is this file descriptor's
>  	 * current egrp. this catches the case where a previous restore
> @@ -5979,7 +5980,7 @@ static void
>  pi_update_stats( off64_t sz )
>  {
>  	pi_lock( );
> -	ASSERT( persp->s.stat_valpr );
> +	assert( persp->s.stat_valpr );
>  	persp->s.stat_inodone++;
>  	persp->s.stat_datadone += sz;
>  	pi_unlock( );
> @@ -6011,7 +6012,7 @@ pi_iter_alloc( void )
>  	pi_iter_t *iterp;
>  
>  	iterp = ( pi_iter_t * )calloc( 1, sizeof( pi_iter_t ));
> -	ASSERT( iterp );
> +	assert( iterp );
>  	return iterp;
>  }
>  
> @@ -6026,7 +6027,7 @@ pi_iter_nextfileh( pi_iter_t *iterp,
>  		   bool_t *objmissingprp,
>  		   bool_t *filemissingprp )
>  {
> -	ASSERT( ! iterp->donepr );
> +	assert( ! iterp->donepr );
>  
>  	if ( persp->s.strmheadh == DH_NULL ) {
>  		iterp->donepr = BOOL_TRUE;
> @@ -6034,7 +6035,7 @@ pi_iter_nextfileh( pi_iter_t *iterp,
>  	}
>  
>  	if ( ! iterp->initializedpr ) {
> -		ASSERT( persp->s.strmheadh != DH_NULL );
> +		assert( persp->s.strmheadh != DH_NULL );
>  		iterp->strmh = persp->s.strmheadh;
>  		iterp->objh = DH2S( iterp->strmh )->s_cldh;
>  		if ( iterp->objh == DH_NULL ) {
> @@ -6199,8 +6200,8 @@ pi_neededobjs_nondir_alloc( bool_t *knownholesprp,
>  			headegrp.eg_ino = INO64MAX;
>  			headegrp.eg_off = OFF64MAX;
>  		} else {
> -			ASSERT( ! ( DH2F( headh )->f_flags & PF_INV ));
> -			ASSERT( ! ( DH2F( headh )->f_flags & PF_TERM ));
> +			assert( ! ( DH2F( headh )->f_flags & PF_INV ));
> +			assert( ! ( DH2F( headh )->f_flags & PF_TERM ));
>  			headegrp = DH2F( headh )->f_firstegrp;
>  		}
>  
> @@ -6369,15 +6370,15 @@ pi_neededobjs_free( bag_t *bagp )
>  	size64_t dummykey;
>  	void *dummypayloadp;
>  
> -	ASSERT( bagp );
> +	assert( bagp );
>  
>  	bagiter_init( bagp, &bagiter );
>  
>  	bagobjp = 0;
>  	while (( bagelemp = bagiter_next( &bagiter, ( void ** )&bagobjp ) )) {
>  		bag_remove( bagp, bagelemp, &dummykey, &dummypayloadp );
> -		ASSERT( bagobjp );
> -		ASSERT( bagobjp == ( bagobj_t * )dummypayloadp );
> +		assert( bagobjp );
> +		assert( bagobjp == ( bagobj_t * )dummypayloadp );
>  		free( ( void * )bagobjp );
>  		bagobjp = 0;
>  	}
> @@ -6441,7 +6442,7 @@ pi_hiteod( ix_t strmix, ix_t objix )
>  	      ix++,
>  	      strmh = DH2S( strmh )->s_nexth )
>  		;
> -	ASSERT( strmh != DH_NULL );
> +	assert( strmh != DH_NULL );
>  
>  	/* get index to last object in stream
>  	 */
> @@ -6451,7 +6452,7 @@ pi_hiteod( ix_t strmix, ix_t objix )
>  	      ;
>  	      objh = DH2O( objh )->o_nexth, objcnt++ )
>  		;
> -	ASSERT( objcnt != 0 );
> +	assert( objcnt != 0 );
>  	lastobjix = objcnt - 1;
>  	
>  	pi_unlock( );
> @@ -6504,7 +6505,7 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
>  	      ix++,
>  	      strmh = DH2S( strmh )->s_nexth )
>  		;
> -	ASSERT( strmh != DH_NULL );
> +	assert( strmh != DH_NULL );
>  
>  	/* get index to last object in stream
>  	 */
> @@ -6514,7 +6515,7 @@ pi_hitnextdump( ix_t strmix, ix_t objix, ix_t lastfileix )
>  	      ;
>  	      objh = DH2O( objh )->o_nexth, objcnt++ )
>  		;
> -	ASSERT( objcnt != 0 );
> +	assert( objcnt != 0 );
>  	lastobjix = objcnt - 1;
>  	
>  	pi_unlock( );
> @@ -6549,7 +6550,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
>  	dh_t objh;
>  	dh_t fileh;
>  
> -	ASSERT( purp == PURP_DIR || purp == PURP_NONDIR );
> +	assert( purp == PURP_DIR || purp == PURP_NONDIR );
>  
>  	pi_lock( );
>  
> @@ -6563,7 +6564,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
>  	      ix++,
>  	      strmh = DH2S( strmh )->s_nexth )
>  		;
> -	ASSERT( strmh != DH_NULL );
> +	assert( strmh != DH_NULL );
>  
>  	/* get handle to indexed object
>  	 */
> @@ -6574,7 +6575,7 @@ pi_know_no_more_on_object( purp_t purp, ix_t strmix, ix_t objix )
>  	      ix++,
>  	      objh = DH2O( objh )->o_nexth )
>  		;
> -	ASSERT( objh != DH_NULL );
> +	assert( objh != DH_NULL );
>  	
>  	/* if don't know last media file on object, return FALSE
>  	 */
> @@ -6627,7 +6628,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
>  	dh_t objh;
>  	dh_t fileh;
>  
> -	ASSERT( purp == PURP_DIR || purp == PURP_NONDIR );
> +	assert( purp == PURP_DIR || purp == PURP_NONDIR );
>  
>  	pi_lock( );
>  
> @@ -6641,7 +6642,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
>  	      ix++,
>  	      strmh = DH2S( strmh )->s_nexth )
>  		;
> -	ASSERT( strmh != DH_NULL );
> +	assert( strmh != DH_NULL );
>  
>  	/* get handle to indexed object
>  	 */
> @@ -6653,7 +6654,7 @@ pi_know_no_more_beyond_on_object( purp_t purp,
>  	      ix++,
>  	      objh = DH2O( objh )->o_nexth )
>  		;
> -	ASSERT( objh != DH_NULL );
> +	assert( objh != DH_NULL );
>  	
>  	/* if don't know last media file on object, return FALSE
>  	 */
> @@ -6741,7 +6742,7 @@ addobj( bag_t *bagp,
>  	bagobj_t *bagobjp;
>  
>  	bagobjp = ( bagobj_t * )calloc( 1, sizeof( bagobj_t ));
> -	ASSERT( bagobjp );
> +	assert( bagobjp );
>  	uuid_copy(bagobjp->id, *idp);
>  	strncpy( bagobjp->label,
>  		 label,
> @@ -6761,7 +6762,7 @@ cntobj( bag_t *bagp )
>  	bagobj_t *bagobjp;
>  	size_t cnt;
>  
> -	ASSERT( bagp );
> +	assert( bagp );
>  
>  	bagiter_init( bagp, &bagiter );
>  	cnt = 0;
> @@ -6833,7 +6834,7 @@ askinvforbaseof( uuid_t baseid, inv_session_t *sessp )
>  	/* close the inventory
>  	 */
>  	ok = inv_close( invtok );
> -	ASSERT( ok );
> +	assert( ok );
>  
>  	/* return id of base session
>  	 */
> @@ -6933,7 +6934,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* query: ask if media changed or declined
> @@ -6950,7 +6951,7 @@ retry:
>  	}
>  	querycnt = 0;
>  	querystr[ querycnt++ ] = question;
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	dontix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("media change declined");
> @@ -6965,7 +6966,7 @@ retry:
>  	}
>  	doix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("media changed");
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	sigintix = IXMAX - 1;
>  
>  	responseix = dlog_multi_query( querystr,
> @@ -6988,7 +6989,7 @@ retry:
>  		ackstr[ ackcnt++ ] = _("media change aborted\n");
>  	} else if ( responseix == invstatix ) {
>  		ackstr[ ackcnt++ ] = "\n";
> -		ASSERT( ackcnt <= ACKMAX );
> +		assert( ackcnt <= ACKMAX );
>  		dlog_multi_ack( ackstr,
>  				ackcnt );
>  		pi_show_nomloglock( );
> @@ -6997,13 +6998,13 @@ retry:
>  		postamblestr[ postamblecnt++ ] = "\n";
>  		postamblestr[ postamblecnt++ ] = fold;
>  		postamblestr[ postamblecnt++ ] = "\n\n";
> -		ASSERT( postamblecnt <= POSTAMBLEMAX );
> +		assert( postamblecnt <= POSTAMBLEMAX );
>  		dlog_end( postamblestr,
>  			  postamblecnt );
>  		goto retry;
>  	} else if ( responseix == neededix ) {
>  		ackstr[ ackcnt++ ] = "\n";
> -		ASSERT( ackcnt <= ACKMAX );
> +		assert( ackcnt <= ACKMAX );
>  		dlog_multi_ack( ackstr,
>  				ackcnt );
>  		display_needed_objects( purp,
> @@ -7015,16 +7016,16 @@ retry:
>  		postamblestr[ postamblecnt++ ] = "\n";
>  		postamblestr[ postamblecnt++ ] = fold;
>  		postamblestr[ postamblecnt++ ] = "\n\n";
> -		ASSERT( postamblecnt <= POSTAMBLEMAX );
> +		assert( postamblecnt <= POSTAMBLEMAX );
>  		dlog_end( postamblestr,
>  			  postamblecnt );
>  		goto retry;
>  	} else {
> -		ASSERT( responseix == sigintix );
> +		assert( responseix == sigintix );
>  		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
>  	}
>  
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_multi_ack( ackstr,
>  			ackcnt );
>  
> @@ -7033,7 +7034,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> @@ -7089,7 +7090,7 @@ retry:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* display vital stats and ask if this one should be restored
> @@ -7105,7 +7106,7 @@ retry:
>  			 "the following dump has been found"
>  			 "\n\n") );
>  	}
> -	ASSERT( strlen( introstring ) < sizeof( introstring ));
> +	assert( strlen( introstring ) < sizeof( introstring ));
>  	display_dump_label( BOOL_FALSE,
>  			    MLOG_NORMAL | MLOG_BARE,
>  			    introstring,
> @@ -7122,14 +7123,14 @@ retry:
>  			_("\ninteractively restore from this dump?\n")
>  				: _("\nrestore this dump?\n");
>  	}
> -	ASSERT( querycnt <= QUERYMAX );
> +	assert( querycnt <= QUERYMAX );
>  	choicecnt = 0;
>  	dontix = choicecnt;
>  	choicestr[ choicecnt++ ] = _("skip");
>  	doix = choicecnt;
>  	choicestr[ choicecnt++ ] = (persp->a.interpr) ?
>  				_("interactively restore\n") : _("restore\n");
> -	ASSERT( choicecnt <= CHOICEMAX );
> +	assert( choicecnt <= CHOICEMAX );
>  	sigintix = IXMAX - 1;
>  
>  	responseix = dlog_multi_query( querystr,
> @@ -7153,11 +7154,11 @@ retry:
>  	} else if ( responseix == dontix ) {
>  		ackstr[ ackcnt++ ] = _("dump skipped\n");
>  	} else {
> -		ASSERT( responseix == sigintix );
> +		assert( responseix == sigintix );
>  		ackstr[ ackcnt++ ] = _("keyboard interrupt\n");
>  	}
>  
> -	ASSERT( ackcnt <= ACKMAX );
> +	assert( ackcnt <= ACKMAX );
>  	dlog_multi_ack( ackstr,
>  			ackcnt );
>  
> @@ -7166,7 +7167,7 @@ retry:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr,
>  		  postamblecnt );
>  
> @@ -7329,8 +7330,8 @@ restore_file_cb( void *cp, bool_t linkpr, char *path1, char *path2 )
>  			return BOOL_FALSE;
>  		}
>  	} else if ( ! tranp->t_toconlypr ) {
> -		ASSERT( path1 );
> -		ASSERT( path2 );
> +		assert( path1 );
> +		assert( path2 );
>  		mlog( MLOG_TRACE,
>  		      "linking %s to %s\n",
>  		      path1,
> @@ -7523,7 +7524,7 @@ restore_reg( drive_t *drivep,
>  		/* set the extended inode flags, except those which must
>  		 * be set only after all data has been restored.
>  		 */
> -		ASSERT( bstatp->bs_extsize >= 0 );
> +		assert( bstatp->bs_extsize >= 0 );
>  		memset((void *)&fsxattr, 0, sizeof( fsxattr ));
>  		fsxattr.fsx_xflags = bstatp->bs_xflags & ~POST_DATA_XFLAGS;
>  		fsxattr.fsx_extsize = (u_int32_t) bstatp->bs_extsize;
> @@ -7604,7 +7605,7 @@ restore_extent_group( drive_t *drivep,
>  		 */
>  		if ( ehdr.eh_type == EXTENTHDR_TYPE_ALIGN ) {
>  			size_t sz;
> -			ASSERT( ehdr.eh_sz <= INTGENMAX );
> +			assert( ehdr.eh_sz <= INTGENMAX );
>  			sz = ( size_t )ehdr.eh_sz;
>  			rv = discard_padding( sz, drivep );
>  			if ( rv != RV_OK ) {
> @@ -7628,7 +7629,7 @@ restore_extent_group( drive_t *drivep,
>  
>  		/* real data
>  		 */
> -		ASSERT( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
> +		assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
>  		bytesread = 0;
>  		rv = restore_extent( fhdrp,
>  				     &ehdr,
> @@ -7971,7 +7972,7 @@ restore_symlink( drive_t *drivep,
>  
>  	/* symlinks always have one extent
>  	 */
> -	ASSERT( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
> +	assert( ehdr.eh_type == EXTENTHDR_TYPE_DATA );
>  
>  	/* read the link path extent
>  	 */
> @@ -8006,7 +8007,7 @@ restore_symlink( drive_t *drivep,
>  		}
>  		return BOOL_FALSE;
>  	}
> -	ASSERT( ( off64_t )nread == ehdr.eh_sz );
> +	assert( ( off64_t )nread == ehdr.eh_sz );
>  	if ( ! scratch ) {
>  		if ( path ) {
>  			mlog( MLOG_VERBOSE | MLOG_WARNING, _(
> @@ -8109,7 +8110,7 @@ read_filehdr( drive_t *drivep, filehdr_t *fhdrp, bool_t fhcs )
>  	default:
>  		return RV_CORE;
>  	}
> -	ASSERT( ( size_t )nread == sizeof( *fhdrp ));
> +	assert( ( size_t )nread == sizeof( *fhdrp ));
>  
>  	mlog( MLOG_NITTY,
>  	      "read file hdr off %lld flags 0x%x ino %llu mode 0x%08x\n",
> @@ -8168,7 +8169,7 @@ read_extenthdr( drive_t *drivep, extenthdr_t *ehdrp, bool_t ehcs )
>  	default:
>  		return RV_CORE;
>  	}
> -	ASSERT( ( size_t )nread == sizeof( *ehdrp ));
> +	assert( ( size_t )nread == sizeof( *ehdrp ));
>  
>  	mlog( MLOG_NITTY,
>  	      "read extent hdr size %lld offset %lld type %d flags %08x\n",
> @@ -8208,8 +8209,8 @@ read_dirent( drive_t *drivep,
>  	direnthdr_t tmpdh;
>  	char *namep;    // beginning of name following the direnthdr_t
>  
> -	ASSERT( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
> -	ASSERT( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
> +	assert( sizeof( direnthdr_t ) == DIRENTHDR_SZ );
> +	assert( sizeof( direnthdr_v1_t ) == DIRENTHDR_SZ );
>  
>  	/* read the head of the dirent
>  	 */
> @@ -8236,7 +8237,7 @@ read_dirent( drive_t *drivep,
>  	default:
>  		return RV_CORE;
>  	}
> -	ASSERT( ( size_t )nread == DIRENTHDR_SZ );
> +	assert( ( size_t )nread == DIRENTHDR_SZ );
>  
>  	if ( grhdrp->gh_version >= GLOBAL_HDR_VERSION_3 ) {
>  		xlate_direnthdr(&tmpdh, dhdrp, 1);
> @@ -8279,15 +8280,15 @@ read_dirent( drive_t *drivep,
>  	/* if null, return
>  	 */
>  	if ( dhdrp->dh_ino == 0 ) {
> -		ASSERT( ( size_t )dhdrp->dh_sz == sizeof( direnthdr_t ));
> +		assert( ( size_t )dhdrp->dh_sz == sizeof( direnthdr_t ));
>  		return RV_OK;
>  	}
>  
>  	/* read the remainder of the dirent.
>  	 */
> -	ASSERT( ( size_t )dhdrp->dh_sz <= direntbufsz );
> -	ASSERT( ( size_t )dhdrp->dh_sz >= sizeof( direnthdr_t ));
> -	ASSERT( ! ( ( size_t )dhdrp->dh_sz & ( DIRENTHDR_ALIGN - 1 )));
> +	assert( ( size_t )dhdrp->dh_sz <= direntbufsz );
> +	assert( ( size_t )dhdrp->dh_sz >= sizeof( direnthdr_t ));
> +	assert( ! ( ( size_t )dhdrp->dh_sz & ( DIRENTHDR_ALIGN - 1 )));
>  	if ( ( size_t )dhdrp->dh_sz > sizeof( direnthdr_t )) {
>  		size_t remsz = ( size_t )dhdrp->dh_sz - sizeof( direnthdr_t );
>  		nread = read_buf( namep,
> @@ -8313,7 +8314,7 @@ read_dirent( drive_t *drivep,
>  		default:
>  			return RV_CORE;
>  		}
> -		ASSERT( ( size_t ) nread == remsz );
> +		assert( ( size_t ) nread == remsz );
>  	}
>  
>  	return RV_OK;
> @@ -8353,7 +8354,7 @@ read_extattrhdr( drive_t *drivep, extattrhdr_t *ahdrp, bool_t ahcs )
>  	default:
>  		return RV_CORE;
>  	}
> -	ASSERT( ( size_t )nread == sizeof( *ahdrp ));
> +	assert( ( size_t )nread == sizeof( *ahdrp ));
>  
>  	mlog( MLOG_NITTY,
>  	      "read extattr hdr sz %u valoff %u flags 0x%x valsz %u cs 0x%x\n",
> @@ -8408,7 +8409,7 @@ discard_padding( size_t sz, drive_t *drivep )
>  			  &rval );
>  	switch( rval ) {
>  	case 0:
> -		ASSERT( ( size_t )nread == sz );
> +		assert( ( size_t )nread == sz );
>  		return RV_OK;
>  	case DRIVE_ERROR_EOF:
>  	case DRIVE_ERROR_EOD:
> @@ -8444,11 +8445,11 @@ restore_extent( filehdr_t *fhdrp,
>  	*bytesreadp = 0;
>  
>  	if ( fd != -1 ) {
> -		ASSERT( path );
> +		assert( path );
>  		/* seek to the beginning of the extent.
>  		 * must be on a basic fs blksz boundary.
>  		 */
> -		ASSERT( ( off & ( off64_t )( BBSIZE - 1 )) == 0 );
> +		assert( ( off & ( off64_t )( BBSIZE - 1 )) == 0 );
>  		new_off = lseek64(  fd, off, SEEK_SET );
>  		if ( new_off < 0 ) {
>  			mlog( MLOG_NORMAL | MLOG_WARNING, _(
> @@ -8462,7 +8463,7 @@ restore_extent( filehdr_t *fhdrp,
>  			fd = -1;
>  			new_off = off;
>  		}
> -		ASSERT( new_off == off );
> +		assert( new_off == off );
>  	}
>  	if ( (fd != -1) && (bstatp->bs_xflags & XFS_XFLAG_REALTIME) ) {
>  		if ( (ioctl(fd, XFS_IOC_DIOINFO, &da) < 0) ) {
> @@ -8530,14 +8531,14 @@ restore_extent( filehdr_t *fhdrp,
>  			return rv;
>  		}
>  		if ( off >= bstatp->bs_size ) {
> -			ASSERT( off == bstatp->bs_size );
> +			assert( off == bstatp->bs_size );
>  			ntowrite = 0;
>  		} else if ((off64_t)sup_bufsz > bstatp->bs_size - off ) {
>  			ntowrite = ( size_t )( bstatp->bs_size - off );
>  		} else {
>  			ntowrite = sup_bufsz;
>  		}
> -		ASSERT( ntowrite <= ( size_t )INTGENMAX );
> +		assert( ntowrite <= ( size_t )INTGENMAX );
>  		if ( ntowrite > 0 ) {
>  			*bytesreadp += ( off64_t )ntowrite;
>  			if ( fd != -1 ) {
> @@ -8562,7 +8563,7 @@ restore_extent( filehdr_t *fhdrp,
>  				      tmp_off += ( off64_t )rval ) {
>  					int rttrunc = 0;
>  					int trycnt = 0;
> -					ASSERT( remaining
> +					assert( remaining
>  						<=
>  						( size_t )INTGENMAX );
>  					/*
> @@ -8608,7 +8609,7 @@ restore_extent( filehdr_t *fhdrp,
>  						nwritten = rval;
>  						break;
>  					}
> -					ASSERT( ( size_t )rval <= remaining );
> +					assert( ( size_t )rval <= remaining );
>  					if ( rval < remaining ) {
>  						mlog( MLOG_NORMAL | MLOG_WARNING,
>  						      _("attempt to "
> @@ -8644,7 +8645,7 @@ restore_extent( filehdr_t *fhdrp,
>  				      off,
>  				      strerror( errno ));
>  			} else {
> -				ASSERT( ( size_t )nwritten < ntowrite );
> +				assert( ( size_t )nwritten < ntowrite );
>  				mlog( MLOG_NORMAL, _(
>  				      "attempt to write %u bytes to %s at "
>  				      "offset %lld failed: only %d bytes "
> @@ -8657,7 +8658,7 @@ restore_extent( filehdr_t *fhdrp,
>  			/* stop attempting to write, but complete reads
>  			 */
>  			fd = -1;
> -			ASSERT( ntowrite <= ( size_t )INTGENMAX );
> +			assert( ntowrite <= ( size_t )INTGENMAX );
>  			nwritten = ( intgen_t )ntowrite;
>  		}
>  		sz -= ( off64_t )sup_bufsz;
> @@ -8673,7 +8674,7 @@ static size_t extattrbufsz = 0; /* size of each extattr buffer */
>  static bool_t
>  extattr_init( size_t drivecnt )
>  {
> -	ASSERT( ! extattrbufp );
> +	assert( ! extattrbufp );
>  	extattrbufsz = EXTATTRHDR_SZ		/* dump hdr */
>  		       +
>  		       NAME_MAX			/* attribute name */
> @@ -8721,7 +8722,7 @@ restore_extattr( drive_t *drivep,
>  	bstat_t *bstatp = &fhdrp->fh_stat;
>  	bool_t isfilerestored = BOOL_FALSE;
>  
> -	ASSERT( extattrbufp );
> +	assert( extattrbufp );
>  
>  	if ( ! isdirpr )
>  		isfilerestored = partial_check(bstatp->bs_ino,  bstatp->bs_size);
> @@ -8745,8 +8746,8 @@ restore_extattr( drive_t *drivep,
>  		}
>  
>  		recsz = ( size_t )ahdrp->ah_sz;
> -		ASSERT( recsz <= extattrbufsz );
> -		ASSERT( recsz >= EXTATTRHDR_SZ );
> +		assert( recsz <= extattrbufsz );
> +		assert( recsz >= EXTATTRHDR_SZ );
>  		nread = read_buf( ( char * )&ahdrp[ 1 ],
>  				  recsz - EXTATTRHDR_SZ,
>  				  ( void * )drivep,
> @@ -8769,7 +8770,7 @@ restore_extattr( drive_t *drivep,
>  		default:
>  			return RV_CORE;
>  		}
> -		ASSERT( nread == ( intgen_t )( recsz - EXTATTRHDR_SZ ));
> +		assert( nread == ( intgen_t )( recsz - EXTATTRHDR_SZ ));
>  
>  		if ( ! persp->a.restoreextattrpr && ! persp->a.restoredmpr ) {
>  			continue;
> @@ -8784,7 +8785,7 @@ restore_extattr( drive_t *drivep,
>  		 * extended attributes.
>  		 */
>  		if ( isdirpr ) {
> -			ASSERT( ! path );
> +			assert( ! path );
>  			if ( dah != DAH_NULL ) {
>  				dirattr_addextattr( dah, ahdrp );
>  			}
> @@ -9297,7 +9298,7 @@ pi_show( char *introstring )
>  	strbuflen = sprintf( strbuf,
>  			     "persistent inventory media file tree%s",
>  			     introstring );
> -	ASSERT( ( size_t )strbuflen < sizeof( strbuf ));
> +	assert( ( size_t )strbuflen < sizeof( strbuf ));
>  	fold_init( fold, strbuf, ':' );
>  	mlog( MLOG_NORMAL | MLOG_BARE | MLOG_NOLOCK,
>  	      "\n%s\n\n",
> @@ -9528,8 +9529,8 @@ display_dump_label( bool_t lockpr,
>  	char media_string_uuid[UUID_STR_LEN + 1];
>  	char fs_string_uuid[UUID_STR_LEN + 1];
>  
> -	ASSERT( scrhdrp->cih_level >= 0 );
> -	ASSERT( scrhdrp->cih_level < 10 );
> +	assert( scrhdrp->cih_level >= 0 );
> +	assert( scrhdrp->cih_level < 10 );
>  	level_string[ 0 ] = ( char )( '0' + ( u_char_t )scrhdrp->cih_level );
>  	level_string[ 1 ] = 0;
>  
> diff --git a/restore/dirattr.c b/restore/dirattr.c
> index fcfa0c8..c829808 100644
> --- a/restore/dirattr.c
> +++ b/restore/dirattr.c
> @@ -36,6 +36,7 @@
>  #include <errno.h>
>  #include <fcntl.h>
>  #include <dirent.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -201,14 +202,14 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( dirattr_pers_t ) <= DIRATTR_PERS_SZ );
> -	ASSERT( ! dtp );
> -	ASSERT( ! dpp );
> +	assert( sizeof( dirattr_pers_t ) <= DIRATTR_PERS_SZ );
> +	assert( ! dtp );
> +	assert( ! dpp );
>  
>  	/* allocate and initialize context
>  	 */
>  	dtp = ( dirattr_tran_t * )calloc( 1, sizeof( dirattr_tran_t ));
> -	ASSERT( dtp );
> +	assert( dtp );
>  	dtp->dt_cachedh = DAH_NULL;
>  	dtp->dt_fd = -1;
>  	dtp->dt_extattrfd = -1;
> @@ -308,11 +309,11 @@ dirattr_init( char *hkdir, bool_t resume, u_int64_t dircnt )
>  
>  	/* mmap the persistent descriptor
>  	 */
> -	ASSERT( ! ( DIRATTR_PERS_SZ % pgsz ));
> +	assert( ! ( DIRATTR_PERS_SZ % pgsz ));
>  	dpp = ( dirattr_pers_t * )mmap_autogrow( DIRATTR_PERS_SZ,
>  				        dtp->dt_fd,
>  				        ( off_t )0 );
> -	ASSERT( dpp );
> +	assert( dpp );
>  	if ( dpp == ( dirattr_pers_t * )-1 ) {
>  		mlog( MLOG_NORMAL | MLOG_ERROR, _(
>  		      "unable to map %s: %s\n"),
> @@ -355,7 +356,7 @@ dirattr_cleanup( void )
>  	}
>  	if ( dpp ) {
>  		rval = munmap( ( void * )dpp, DIRATTR_PERS_SZ );
> -		ASSERT( ! rval );
> +		assert( ! rval );
>  		dpp = 0;
>  	}
>  	if ( dtp->dt_fd >= 0 ) {
> @@ -392,8 +393,8 @@ dirattr_add( filehdr_t *fhdrp )
>  	
>  	/* sanity checks
>  	 */
> -	ASSERT( dtp );
> -	ASSERT( dpp );
> +	assert( dtp );
> +	assert( dpp );
>  
>  	/* make sure file pointer is positioned to write at end of file
>  	 */
> @@ -406,7 +407,7 @@ dirattr_add( filehdr_t *fhdrp )
>  			      strerror( errno ));
>  			return DAH_NULL;
>  		}
> -		ASSERT( dpp->dp_appendoff == newoff );
> +		assert( dpp->dp_appendoff == newoff );
>  		dtp->dt_at_endpr = BOOL_TRUE;
>  	}
>  
> @@ -420,7 +421,7 @@ dirattr_add( filehdr_t *fhdrp )
>  	 */
>  	oldoff = dpp->dp_appendoff;
>  	dix = OFF2DIX( oldoff );
> -	ASSERT( dix <= DIX_MAX );
> +	assert( dix <= DIX_MAX );
>  
>  	/* populate a dirattr
>  	 */
> @@ -449,7 +450,7 @@ dirattr_add( filehdr_t *fhdrp )
>  
>  	/* update the next write offset
>  	 */
> -	ASSERT( dpp->dp_appendoff <= OFF64MAX - ( off64_t )sizeof(dirattr_t) );
> +	assert( dpp->dp_appendoff <= OFF64MAX - ( off64_t )sizeof(dirattr_t) );
>  	dpp->dp_appendoff += ( off64_t )sizeof(dirattr_t);
>  
>  #ifdef DIRATTRCHK
> @@ -514,7 +515,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
>  			dtp->dt_extattrfdbadpr = BOOL_TRUE;
>  			return;
>  		}
> -		ASSERT( seekoff == off );
> +		assert( seekoff == off );
>  
>  		oldoff = off;
>  
> @@ -595,7 +596,7 @@ dirattr_addextattr( dah_t dah, extattrhdr_t *ahdrp )
>  			dtp->dt_extattrfdbadpr = BOOL_TRUE;
>  			return;
>  		}
> -		ASSERT( seekoff == oldoff );
> +		assert( seekoff == oldoff );
>  		nwritten = write( dtp->dt_extattrfd,
>  				  ( void * )&off,
>  				  sizeof( off ));
> @@ -672,7 +673,7 @@ dirattr_cb_extattr( dah_t dah,
>  			dtp->dt_extattrfdbadpr = BOOL_TRUE;
>  			return BOOL_TRUE;
>  		}
> -		ASSERT( seekoff == off );
> +		assert( seekoff == off );
>  
>  		/* peel off the next offset
>  		 */
> @@ -711,7 +712,7 @@ dirattr_cb_extattr( dah_t dah,
>  		/* read the remainder of the extattr
>  		 */
>  		recsz = ( size_t )ahdrp->ah_sz;
> -		ASSERT( recsz >= EXTATTRHDR_SZ );
> +		assert( recsz >= EXTATTRHDR_SZ );
>  		nread = read( dtp->dt_extattrfd,
>  			      ( void * )&ahdrp[ 1 ],
>  			      recsz - EXTATTRHDR_SZ );
> @@ -756,10 +757,10 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( dtp );
> -	ASSERT( dpp );
> +	assert( dtp );
> +	assert( dpp );
>  
> -	ASSERT( dah != DAH_NULL );
> +	assert( dah != DAH_NULL );
>  
>  #ifdef DIRATTRCHK
>  	sum = HDLGETSUM( dah );
> @@ -768,18 +769,18 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
>  	dix = ( dix_t )dah;
>  #endif /* DIRATTRCHK */
>  
> -	ASSERT( dix >= 0 );
> -	ASSERT( dix <= DIX_MAX );
> +	assert( dix >= 0 );
> +	assert( dix <= DIX_MAX );
>  
>  	argoff = DIX2OFF( dix );
> -	ASSERT( argoff >= 0 );
> -	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> -	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
> +	assert( argoff >= 0 );
> +	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> +	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
>  
>  #ifdef DIRATTRCHK
>  	dirattr_get( dah );
> -	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> -	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
> +	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> +	assert( dtp->dt_cached_dirattr.d_sum == sum );
>  #endif /* DIRATTRCHK */
>  
>  	if ( dtp->dt_at_endpr && dtp->dt_off ) {
> @@ -796,9 +797,9 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
>  		mlog( MLOG_NORMAL, _(
>  		      "lseek of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
> -	ASSERT( newoff == argoff );
> +	assert( newoff == argoff );
>  
>  	/* populate a dirattr
>  	 */
> @@ -822,7 +823,7 @@ dirattr_update( dah_t dah, filehdr_t *fhdrp )
>  		mlog( MLOG_NORMAL, _(
>  		      "update of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
>  
>  	dtp->dt_at_endpr = BOOL_FALSE;
> @@ -959,10 +960,10 @@ dirattr_get( dah_t dah )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( dtp );
> -	ASSERT( dpp );
> +	assert( dtp );
> +	assert( dpp );
>  
> -	ASSERT( dah != DAH_NULL );
> +	assert( dah != DAH_NULL );
>  
>  	/* if we are already holding this dirattr in cache,
>  	 * just return
> @@ -977,13 +978,13 @@ dirattr_get( dah_t dah )
>  #else /* DIRATTRCHK */
>  	dix = ( dix_t )dah;
>  #endif /* DIRATTRCHK */
> -	ASSERT( dix >= 0 );
> -	ASSERT( dix <= DIX_MAX );
> +	assert( dix >= 0 );
> +	assert( dix <= DIX_MAX );
>  
>  	argoff = DIX2OFF( dix );
> -	ASSERT( argoff >= 0 );
> -	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> -	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
> +	assert( argoff >= 0 );
> +	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> +	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
>  
>  	if ( dtp->dt_at_endpr && dtp->dt_off ) {
>  		if (dirattr_flush() != RV_OK) {
> @@ -999,9 +1000,9 @@ dirattr_get( dah_t dah )
>  		mlog( MLOG_NORMAL, _(
>  		      "lseek of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
> -	ASSERT( newoff == argoff );
> +	assert( newoff == argoff );
>  
>  	/* read the dirattr
>  	 */
> @@ -1012,12 +1013,12 @@ dirattr_get( dah_t dah )
>  		mlog( MLOG_NORMAL, _(
>  		      "read of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
>  
>  #ifdef DIRATTRCHK
> -	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> -	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
> +	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> +	assert( dtp->dt_cached_dirattr.d_sum == sum );
>  #endif /* DIRATTRCHK */
>  
>  	dtp->dt_at_endpr = BOOL_FALSE;
> @@ -1038,13 +1039,13 @@ dirattr_cacheflush( void )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( dtp );
> -	ASSERT( dpp );
> +	assert( dtp );
> +	assert( dpp );
>  
>  	/* if nothing in the cache, ignore
>  	 */
>  	dah = dtp->dt_cachedh;
> -	ASSERT( dah != DAH_NULL );
> +	assert( dah != DAH_NULL );
>  	if ( dah == DAH_NULL ) {
>  		return;
>  	}
> @@ -1057,17 +1058,17 @@ dirattr_cacheflush( void )
>  #endif /* DIRATTRCHK */
>  
>  #ifdef DIRATTRCHK
> -	ASSERT( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> -	ASSERT( dtp->dt_cached_dirattr.d_sum == sum );
> +	assert( dtp->dt_cached_dirattr.d_unq == DIRATTRUNQ );
> +	assert( dtp->dt_cached_dirattr.d_sum == sum );
>  #endif /* DIRATTRCHK */
>  
> -	ASSERT( dix >= 0 );
> -	ASSERT( dix <= DIX_MAX );
> +	assert( dix >= 0 );
> +	assert( dix <= DIX_MAX );
>  
>  	argoff = DIX2OFF( dix );
> -	ASSERT( argoff >= 0 );
> -	ASSERT( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> -	ASSERT( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
> +	assert( argoff >= 0 );
> +	assert( argoff >= ( off64_t )DIRATTR_PERS_SZ );
> +	assert( argoff <= dpp->dp_appendoff - ( off64_t )sizeof( dirattr_t ));
>  
>  	/* seek to the dirattr
>  	 */
> @@ -1076,9 +1077,9 @@ dirattr_cacheflush( void )
>  		mlog( MLOG_NORMAL, _(
>  		      "lseek of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
> -	ASSERT( newoff == argoff );
> +	assert( newoff == argoff );
>  
>  	/* write the dirattr
>  	 */
> @@ -1089,7 +1090,7 @@ dirattr_cacheflush( void )
>  		mlog( MLOG_NORMAL, _(
>  		      "flush of dirattr failed: %s\n"),
>  		      strerror( errno ));
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
>  
>  	dtp->dt_at_endpr = BOOL_FALSE;
> @@ -1104,7 +1105,7 @@ calcdixcum( dix_t dix )
>  	ix_t nibcnt;
>  	ix_t nibix;
>  
> -	ASSERT( ( sizeof( dah_t ) / HDLSUMCNT ) * HDLSUMCNT == sizeof( dah_t ));
> +	assert( ( sizeof( dah_t ) / HDLSUMCNT ) * HDLSUMCNT == sizeof( dah_t ));
>  
>  	nibcnt = ( sizeof( dah_t ) / HDLSUMCNT ) - 1;
>  	sum = 0;
> diff --git a/restore/inomap.c b/restore/inomap.c
> index 562492e..2c62afc 100644
> --- a/restore/inomap.c
> +++ b/restore/inomap.c
> @@ -26,6 +26,7 @@
>  #include <fcntl.h>
>  #include <dirent.h>
>  #include <time.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "util.h"
> @@ -195,9 +196,9 @@ inomap_restore_pers( drive_t *drivep,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
> -	ASSERT( sizeof( hnk_t ) == HNKSZ );
> -	ASSERT( sizeof( pers_t ) <= PERSSZ );
> +	assert( INOPERSEG == ( sizeof( (( seg_t * )0 )->lobits ) * NBBY ));
> +	assert( sizeof( hnk_t ) == HNKSZ );
> +	assert( sizeof( pers_t ) <= PERSSZ );
>  
>  	/* get inomap info from media hdr
>  	 */
> @@ -243,7 +244,7 @@ inomap_restore_pers( drive_t *drivep,
>  	persp->last_ino_added = last_ino_added;
>  
>  	tmphnkp = ( hnk_t * )calloc( ( size_t )hnkcnt, sizeof( hnk_t ));
> -	ASSERT( tmphnkp );
> +	assert( tmphnkp );
>  
>  	/* read the map in from media
>  	 */
> @@ -268,7 +269,7 @@ inomap_restore_pers( drive_t *drivep,
>  		        PERSSZ
>  		        +
>  		        sizeof( hnk_t ) * ( size_t )hnkcnt );
> -	ASSERT( ! rval1 );
> +	assert( ! rval1 );
>  	( void )close( fd );
>  	free( ( void * )perspath );
>  
> @@ -278,7 +279,7 @@ inomap_restore_pers( drive_t *drivep,
>  	 */
>  	switch( rval ) {
>  	case 0:
> -		ASSERT( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
> +		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
>  		ok = inomap_sync_pers( hkdir );
>  		if ( ! ok ) {
>  			return RV_ERROR;
> @@ -325,7 +326,7 @@ inomap_discard( drive_t *drivep, content_inode_hdr_t *scrhdrp )
>  	 */
>  	switch( rval ) {
>  	case 0:
> -		ASSERT( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
> +		assert( ( size_t )nread == sizeof( hnk_t ) * ( size_t )hnkcnt );
>  		return RV_OK;
>  	case DRIVE_ERROR_EOD:
>  	case DRIVE_ERROR_EOF:
> @@ -350,7 +351,7 @@ inomap_sync_pers( char *hkdir )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( hnk_t ) == HNKSZ );
> +	assert( sizeof( hnk_t ) == HNKSZ );
>  
>  	/* only needed once per session
>  	 */
> @@ -388,7 +389,7 @@ inomap_sync_pers( char *hkdir )
>  
>  	/* mmap the pers inomap
>  	 */
> -	ASSERT( hnkcnt * sizeof( hnk_t ) <= ( size64_t )INT32MAX );
> +	assert( hnkcnt * sizeof( hnk_t ) <= ( size64_t )INT32MAX );
>  	roothnkp = ( hnk_t * ) mmap_autogrow(
>  				       sizeof( hnk_t ) * ( size_t )hnkcnt,
>  				       pers_fd,
> @@ -415,7 +416,7 @@ inomap_sync_pers( char *hkdir )
>  	/* calculate the tail pointers
>  	 */
>  	tailhnkp = hnkp;
> -	ASSERT( hnkcnt > 0 );
> +	assert( hnkcnt > 0 );
>  	lastsegp = &tailhnkp->seg[ ( intgen_t )( segcnt
>  						 -
>  						 SEGPERHNK * ( hnkcnt - 1 )
> @@ -485,7 +486,7 @@ inomap_sanitize( void )
>  void
>  inomap_rst_add( xfs_ino_t ino )
>  {
> -		ASSERT( pers_fd >= 0 );
> +		assert( pers_fd >= 0 );
>  		( void )map_set( ino, MAP_NDR_CHANGE );
>  }
>  
> @@ -494,7 +495,7 @@ inomap_rst_add( xfs_ino_t ino )
>  void
>  inomap_rst_del( xfs_ino_t ino )
>  {
> -		ASSERT( pers_fd >= 0 );
> +		assert( pers_fd >= 0 );
>  		( void )map_set( ino, MAP_NDR_NOREST );
>  }
>  
> diff --git a/restore/namreg.c b/restore/namreg.c
> index 41362d1..c64833d 100644
> --- a/restore/namreg.c
> +++ b/restore/namreg.c
> @@ -24,6 +24,7 @@
>  #include <sys/ioctl.h>
>  #include <fcntl.h>
>  #include <errno.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "lock.h"
> @@ -118,15 +119,15 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( ! ntp );
> -	ASSERT( ! npp );
> +	assert( ! ntp );
> +	assert( ! npp );
>  
> -	ASSERT( sizeof( namreg_pers_t ) <= NAMREG_PERS_SZ );
> +	assert( sizeof( namreg_pers_t ) <= NAMREG_PERS_SZ );
>  
>  	/* allocate and initialize context
>  	 */
>  	ntp = ( namreg_tran_t * )calloc( 1, sizeof( namreg_tran_t ));
> -	ASSERT( ntp );
> +	assert( ntp );
>  
>  	/* generate a string containing the pathname of the namreg file
>  	 */
> @@ -223,7 +224,7 @@ namreg_init( char *hkdir, bool_t resume, u_int64_t inocnt )
>  
>  	/* mmap the persistent descriptor
>  	 */
> -	ASSERT( ! ( NAMREG_PERS_SZ % pgsz ));
> +	assert( ! ( NAMREG_PERS_SZ % pgsz ));
>  	npp = ( namreg_pers_t * ) mmap_autogrow(
>  				        NAMREG_PERS_SZ,
>  				        ntp->nt_fd,
> @@ -258,9 +259,9 @@ namreg_add( char *name, size_t namelen )
>  	
>  	/* sanity checks
>  	 */
> -	ASSERT( ntp );
> -	ASSERT( npp );
> -	ASSERT( !ntp->nt_map );
> +	assert( ntp );
> +	assert( npp );
> +	assert( !ntp->nt_map );
>  
>  	/* make sure file pointer is positioned to append
>  	 */
> @@ -271,10 +272,10 @@ namreg_add( char *name, size_t namelen )
>  			mlog( MLOG_NORMAL, _(
>  			      "lseek of namreg failed: %s\n"),
>  			      strerror( errno ));
> -			ASSERT( 0 );
> +			assert( 0 );
>  			return NRH_NULL;
>  		}
> -		ASSERT( npp->np_appendoff == newoff );
> +		assert( npp->np_appendoff == newoff );
>  		ntp->nt_at_endpr = BOOL_TRUE;
>  	}
>  
> @@ -290,7 +291,7 @@ namreg_add( char *name, size_t namelen )
>  
>  	/* write a one byte unsigned string length into the buffer.
>  	 */
> -	ASSERT( namelen < 256 );
> +	assert( namelen < 256 );
>  	c = ( unsigned char )( namelen & 0xff );
>  	ntp->nt_buf[ntp->nt_off++] = c;
>  
> @@ -300,7 +301,7 @@ namreg_add( char *name, size_t namelen )
>  	ntp->nt_off += namelen;
>  
>  	npp->np_appendoff += ( off64_t )( 1 + namelen );
> -	ASSERT( oldoff <= HDLMAX );
> +	assert( oldoff <= HDLMAX );
>  
>  #ifdef NAMREGCHK
>  
> @@ -375,12 +376,12 @@ namreg_get( nrh_t nrh,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( ntp );
> -	ASSERT( npp );
> +	assert( ntp );
> +	assert( npp );
>  
>  	/* make sure we aren't being given a NULL handle
>  	 */
> -	ASSERT( nrh != NRH_NULL );
> +	assert( nrh != NRH_NULL );
>  
>  	/* convert the handle into the offset
>  	 */
> @@ -397,9 +398,9 @@ namreg_get( nrh_t nrh,
>  
>  	/* do sanity check on offset
>  	 */
> -	ASSERT( newoff <= HDLMAX );
> -	ASSERT( newoff < npp->np_appendoff );
> -	ASSERT( newoff >= ( off64_t )NAMREG_PERS_SZ );
> +	assert( newoff <= HDLMAX );
> +	assert( newoff < npp->np_appendoff );
> +	assert( newoff >= ( off64_t )NAMREG_PERS_SZ );
>  
>  	lock( );
>  
> @@ -461,7 +462,7 @@ namreg_get( nrh_t nrh,
>  
>  	/* validate the checkbit
>  	 */
> -	ASSERT( chkbit
> +	assert( chkbit
>  		==
>  		( ( ( nrh_t )len + ( nrh_t )bufp[ 0 ] ) & CHKBITLOMASK ));
>  
> diff --git a/restore/node.c b/restore/node.c
> index 4cc8fb0..f0297a5 100644
> --- a/restore/node.c
> +++ b/restore/node.c
> @@ -23,6 +23,7 @@
>  #include <errno.h>
>  #include <memory.h>
>  #include <limits.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -188,9 +189,9 @@ node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
>  	register u_char_t nodeunq;
>  #endif /* NODECHK */
>  
> -	ASSERT( pp );
> -	ASSERT( *pp );
> -	ASSERT( nh != NH_NULL );
> +	assert( pp );
> +	assert( *pp );
> +	assert( nh != NH_NULL );
>  
>  	/* convert the handle into an index
>  	 */
> @@ -199,19 +200,19 @@ node_unmap_internal( nh_t nh, void **pp, bool_t freepr )
>  	nh = HDLGETNHDL( nh );
>  #endif /* NODECHK */
>  
> -	ASSERT( nh <= NH_MAX );
> +	assert( nh <= NH_MAX );
>  
>  #ifdef NODECHK
>  	hkp = *( *( u_char_t ** )pp + node_hdrp->nh_nodehkix );
>  	nodegen = HKPGETGEN( hkp );
> -	ASSERT( nodegen == hdlgen );
> +	assert( nodegen == hdlgen );
>  	nodeunq = HKPGETUNQ( hkp );
>  	if ( ! freepr ) {
> -		ASSERT( nodeunq != NODEUNQFREE );
> -		ASSERT( nodeunq == NODEUNQALCD );
> +		assert( nodeunq != NODEUNQFREE );
> +		assert( nodeunq == NODEUNQALCD );
>  	} else {
> -		ASSERT( nodeunq != NODEUNQALCD );
> -		ASSERT( nodeunq == NODEUNQFREE );
> +		assert( nodeunq != NODEUNQALCD );
> +		assert( nodeunq == NODEUNQFREE );
>  	}
>  #endif /* NODECHK */
>  
> @@ -240,16 +241,16 @@ node_init( intgen_t fd,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( node_hdr_t ) <= NODE_HDRSZ );
> -	ASSERT( sizeof( nh_t ) < sizeof( off64_t ));
> -	ASSERT( sizeof( nh_t ) <= sizeof( segix_t ));
> -	ASSERT( sizeof( nh_t ) <= sizeof( relnix_t ));
> -	ASSERT( nodehkix < usrnodesz );
> -	ASSERT( usrnodesz >= sizeof( char * ) + 1 );
> +	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
> +	assert( sizeof( nh_t ) < sizeof( off64_t ));
> +	assert( sizeof( nh_t ) <= sizeof( segix_t ));
> +	assert( sizeof( nh_t ) <= sizeof( relnix_t ));
> +	assert( nodehkix < usrnodesz );
> +	assert( usrnodesz >= sizeof( char * ) + 1 );
>  		/* so node is at least big enough to hold
>  		 * the free list linkage and the housekeeping byte
>  		 */
> -	ASSERT( nodehkix > sizeof( char * ));
> +	assert( nodehkix > sizeof( char * ));
>  		/* since beginning of each node is used to
>  		 * link it in the free list.
>  		 */
> @@ -283,7 +284,7 @@ node_init( intgen_t fd,
>  	 * reasonable cap on the max number of segments.
>  	 */
>  
> -	ASSERT( NODESPERSEG_MIN >= pgsz );
> +	assert( NODESPERSEG_MIN >= pgsz );
>  
>  	if ( vmsz < WINMAP_MIN * NODESPERSEG_MIN * nodesz ) {
>  		mlog( MLOG_NORMAL | MLOG_ERROR, _(
> @@ -331,10 +332,10 @@ node_init( intgen_t fd,
>  
>  	/* map the abstraction header
>  	 */
> -	ASSERT( ( NODE_HDRSZ & pgmask ) == 0 );
> -	ASSERT( ! ( NODE_HDRSZ % pgsz ));
> -	ASSERT( off <= OFF64MAX );
> -	ASSERT( ! ( off % ( off64_t )pgsz ));
> +	assert( ( NODE_HDRSZ & pgmask ) == 0 );
> +	assert( ! ( NODE_HDRSZ % pgsz ));
> +	assert( off <= OFF64MAX );
> +	assert( ! ( off % ( off64_t )pgsz ));
>  	node_hdrp = ( node_hdr_t * )mmap_autogrow(
>  					    NODE_HDRSZ,
>  					    fd,
> @@ -394,13 +395,13 @@ node_sync( intgen_t fd, off64_t off )
>  {
>  	/* sanity checks
>  	 */
> -	ASSERT( sizeof( node_hdr_t ) <= NODE_HDRSZ );
> +	assert( sizeof( node_hdr_t ) <= NODE_HDRSZ );
>  
>  	/* map the abstraction header
>  	 */
> -	ASSERT( ( NODE_HDRSZ & pgmask ) == 0 );
> -	ASSERT( off <= ( off64_t )OFF64MAX );
> -	ASSERT( ! ( off % ( off64_t )pgsz ));
> +	assert( ( NODE_HDRSZ & pgmask ) == 0 );
> +	assert( off <= ( off64_t )OFF64MAX );
> +	assert( ! ( off % ( off64_t )pgsz ));
>  	node_hdrp = ( node_hdr_t * )mmap_autogrow(
>  					    NODE_HDRSZ,
>  					    fd,
> @@ -454,8 +455,8 @@ node_alloc( void )
>  		hkpp = p + node_hdrp->nh_nodehkix;
>  		gen = ( u_char_t )( HKPGETGEN( *p ) + ( u_char_t )1 );
>  		unq = HKPGETUNQ( *hkpp );
> -		ASSERT( unq != NODEUNQALCD );
> -		ASSERT( unq == NODEUNQFREE );
> +		assert( unq != NODEUNQALCD );
> +		assert( unq == NODEUNQFREE );
>  #endif /* NODECHK */
>  
>  		/* adjust the free list */
> @@ -473,7 +474,7 @@ node_alloc( void )
>  				( off64_t )nh2segix( node_hdrp->nh_virgnh ) *
>  				( off64_t )node_hdrp->nh_segsz;
>  
> -			ASSERT( new_seg_off
> +			assert( new_seg_off
>  				<=
>  				OFF64MAX - ( off64_t )node_hdrp->nh_segsz );
>  			mlog( MLOG_DEBUG,
> @@ -531,7 +532,7 @@ node_map( nh_t nh )
>  	register u_char_t nodeunq;
>  #endif /* NODECHK */
>  
> -	ASSERT( nh != NH_NULL );
> +	assert( nh != NH_NULL );
>  
>  	/* convert the handle into an index
>  	 */
> @@ -540,7 +541,7 @@ node_map( nh_t nh )
>  	nh = HDLGETNHDL( nh );
>  #endif /* NODECHK */
>  
> -	ASSERT( nh <= NH_MAX );
> +	assert( nh <= NH_MAX );
>  
>  	/* map in
>  	 */
> @@ -553,9 +554,9 @@ node_map( nh_t nh )
>  	hkp = *( p + node_hdrp->nh_nodehkix );
>  	nodegen = HKPGETGEN( hkp );
>  	nodeunq = HKPGETUNQ( hkp );
> -	ASSERT( nodegen == hdlgen );
> -	ASSERT( nodeunq != NODEUNQFREE );
> -	ASSERT( nodeunq == NODEUNQALCD );
> +	assert( nodegen == hdlgen );
> +	assert( nodeunq != NODEUNQFREE );
> +	assert( nodeunq == NODEUNQALCD );
>  #endif /* NODECHK */
>  
>  	return ( void * )p;
> @@ -580,9 +581,9 @@ node_free( nh_t *nhp )
>  	register u_char_t nodeunq;
>  #endif /* NODECHK */
>  
> -	ASSERT( nhp );
> +	assert( nhp );
>  	nh = *nhp;
> -	ASSERT( nh != NH_NULL );
> +	assert( nh != NH_NULL );
>  
>  	/* convert the handle into an index
>  	 */
> @@ -591,7 +592,7 @@ node_free( nh_t *nhp )
>  	nh = HDLGETNHDL( nh );
>  #endif /* NODECHK */
>  
> -	ASSERT( nh <= NH_MAX );
> +	assert( nh <= NH_MAX );
>  
>  	/* map in
>  	 */
> @@ -607,9 +608,9 @@ node_free( nh_t *nhp )
>  	hkpp = p + node_hdrp->nh_nodehkix;
>  	nodegen = HKPGETGEN( *hkpp );
>  	nodeunq = HKPGETUNQ( *hkpp );
> -	ASSERT( nodegen == hdlgen );
> -	ASSERT( nodeunq != NODEUNQFREE );
> -	ASSERT( nodeunq == NODEUNQALCD );
> +	assert( nodegen == hdlgen );
> +	assert( nodeunq != NODEUNQFREE );
> +	assert( nodeunq == NODEUNQALCD );
>  	*hkpp = HKPMKHKP( nodegen, NODEUNQFREE );
>  #endif /* NODECHK */
>  
> diff --git a/restore/tree.c b/restore/tree.c
> index 08e177f..d377590 100644
> --- a/restore/tree.c
> +++ b/restore/tree.c
> @@ -28,6 +28,7 @@
>  #include <xfs/handle.h>
>  #include <dirent.h>
>  #include <sys/ioctl.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "exit.h"
> @@ -351,16 +352,16 @@ tree_init( char *hkdir,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( ! ( PERSSZ % pgsz ));
> -	ASSERT( sizeof( persp ) <= PERSSZ );
> -	ASSERT( sizeof( node_t ) <= NODESZ );
> -	ASSERT( ! persp );
> -	ASSERT( ! tranp );
> +	assert( ! ( PERSSZ % pgsz ));
> +	assert( sizeof( persp ) <= PERSSZ );
> +	assert( sizeof( node_t ) <= NODESZ );
> +	assert( ! persp );
> +	assert( ! tranp );
>  
>  	/* allocate transient state
>  	 */
>  	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
> -	ASSERT( tranp );
> +	assert( tranp );
>  
>  	tranp->t_toconlypr = toconlypr;
>  	tranp->t_hkdir = hkdir;
> @@ -425,7 +426,7 @@ tree_init( char *hkdir,
>  
>  	/* mmap the persistent state
>  	 */
> -	ASSERT( ! ( PERSSZ % pgsz ));
> +	assert( ! ( PERSSZ % pgsz ));
>  	persp = ( treepers_t * ) mmap_autogrow(
>  				     PERSSZ,
>  				     tranp->t_persfd,
> @@ -450,9 +451,9 @@ tree_init( char *hkdir,
>  	 * begin immediately after the hash abstraction. give it the remainder
>  	 * of vm.
>  	 */
> -	ASSERT( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
> +	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
>  	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
> -	ASSERT( vmsz > ( size64_t )nodeoff );
> +	assert( vmsz > ( size64_t )nodeoff );
>  	ok = node_init( tranp->t_persfd, 
>  		        nodeoff,
>  		        NODESZ,
> @@ -539,16 +540,16 @@ tree_sync( char *hkdir,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( ! ( PERSSZ % pgsz ));
> -	ASSERT( sizeof( persp ) <= PERSSZ );
> -	ASSERT( sizeof( node_t ) <= NODESZ );
> -	ASSERT( ! persp );
> -	ASSERT( ! tranp );
> +	assert( ! ( PERSSZ % pgsz ));
> +	assert( sizeof( persp ) <= PERSSZ );
> +	assert( sizeof( node_t ) <= NODESZ );
> +	assert( ! persp );
> +	assert( ! tranp );
>  
>  	/* allocate transient state
>  	 */
>  	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
> -	ASSERT( tranp );
> +	assert( tranp );
>  
>  	tranp->t_toconlypr = toconlypr;
>  	tranp->t_hkdir = hkdir;
> @@ -600,7 +601,7 @@ tree_sync( char *hkdir,
>  
>  	/* mmap the persistent state
>  	 */
> -	ASSERT( ! ( PERSSZ % pgsz ));
> +	assert( ! ( PERSSZ % pgsz ));
>  	persp = ( treepers_t * ) mmap_autogrow(
>  				     PERSSZ,
>  				     tranp->t_persfd,
> @@ -637,7 +638,7 @@ tree_sync( char *hkdir,
>  
>  	/* synchronize with the node abstraction.
>  	 */
> -	ASSERT( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
> +	assert( persp->p_hashsz <= ( size64_t )( OFF64MAX - ( off64_t )PERSSZ));
>  	nodeoff = ( off64_t )PERSSZ + ( off64_t )persp->p_hashsz;
>  	ok = node_sync( tranp->t_persfd, nodeoff );
>  	if ( ! ok ) {
> @@ -687,7 +688,7 @@ tree_marknoref( void )
>  		node_t *orphp;
>  		orphp = Node_map( persp->p_orphh );
>  		orphp->n_flags |= ( NF_REFED | NF_DUMPEDDIR );
> -		ASSERT( orphp->n_dah == DAH_NULL );
> +		assert( orphp->n_dah == DAH_NULL );
>  		Node_unmap( persp->p_orphh, &orphp );
>  	}
>  }
> @@ -740,12 +741,12 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
>  
>  	/* sanity check - orphino is supposed to be an unused ino!
>  	 */
> -	ASSERT( ino != orphino );
> +	assert( ino != orphino );
>  
>  	/* lookup head of hardlink list
>  	 */
>  	hardh = link_hardh( ino, gen );
> -	ASSERT( ino != persp->p_rootino || hardh == persp->p_rooth );
> +	assert( ino != persp->p_rootino || hardh == persp->p_rooth );
>  
>  	/* already present
>  	 */
> @@ -762,7 +763,7 @@ tree_begindir( filehdr_t *fhdrp, dah_t *dahp )
>  			      gen,
>  			      fhdrp->fh_stat.bs_gen );
>  			if ( ! tranp->t_toconlypr ) {
> -				ASSERT( hardp->n_dah == DAH_NULL );
> +				assert( hardp->n_dah == DAH_NULL );
>  				hardp->n_dah = dirattr_add( fhdrp );
>  			}
>  		} else if ( ! tranp->t_toconlypr && hardp->n_dah == DAH_NULL ) {
> @@ -829,7 +830,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  
>  	/* sanity check - orphino is supposed to be an unused ino!
>  	 */
> -	ASSERT( ino != orphino );
> +	assert( ino != orphino );
>  
>  	/* don't allow entries named "orphanage" under root to be added
>  	 */
> @@ -885,7 +886,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  						return RV_ERROR;
>  				}
>  				if ( hardp->n_lnkh != NH_NULL ) {
> -					ASSERT( hardp->n_flags & NF_REAL );
> +					assert( hardp->n_flags & NF_REAL );
>  					renameh = hardp->n_lnkh;
>  					renamep = Node_map( renameh );
>  					if ( renamep->n_parh == NH_NULL ) {
> @@ -912,7 +913,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  						namreg_get( renamep->n_nrh,
>  							    tranp->t_namebuf,
>  						    sizeof( tranp->t_namebuf ));
> -						ASSERT( namebuflen > 0 );
> +						assert( namebuflen > 0 );
>  						if ( strcmp( name,
>  							   tranp->t_namebuf )) {
>  							mlog( MLOG_DEBUG
> @@ -944,10 +945,10 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  					nrh_t nrh;
>  
>  					hardp->n_flags &= ~NF_NEWORPH;
> -					ASSERT( hardp->n_nrh == NRH_NULL );
> -					ASSERT( hardp->n_parh != NH_NULL );
> +					assert( hardp->n_nrh == NRH_NULL );
> +					assert( hardp->n_parh != NH_NULL );
>  					nrh = disown( hardh );
> -					ASSERT( nrh == NRH_NULL );
> +					assert( nrh == NRH_NULL );
>  					nrh = namreg_add( name, namelen );
>  					adopt( parh, hardh, nrh );
>  					mlog( MLOG_DEBUG | MLOG_TREE,
> @@ -958,13 +959,13 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  					      gen );
>  				}
>  			} else {
> -				ASSERT( hardp->n_nrh != NRH_NULL );
> +				assert( hardp->n_nrh != NRH_NULL );
>  				namebuflen
>  				=
>  				namreg_get( hardp->n_nrh,
>  					    tranp->t_namebuf,
>  					    sizeof( tranp->t_namebuf ));
> -				ASSERT( namebuflen > 0 );
> +				assert( namebuflen > 0 );
>  				if ( hardp->n_parh == parh
>  				     &&
>  				     ! strcmp( tranp->t_namebuf, name )) {
> @@ -1021,7 +1022,7 @@ tree_addent( nh_t parh, xfs_ino_t ino, gen_t gen, char *name, size_t namelen )
>  						Node_unmap( renameh, &renamep );
>  					}
>  					renamep = Node_map( renameh );
> -					ASSERT( hardp->n_parh != NH_NULL );
> +					assert( hardp->n_parh != NH_NULL );
>  					if ( hardp->n_parh != parh ) {
>  						/* different parent
>  						 */
> @@ -1220,7 +1221,7 @@ tree_post( char *path1, char *path2 )
>  	}
>  
>  #ifdef TREE_CHK
> -	ASSERT( tree_chk( ));
> +	assert( tree_chk( ));
>  #endif /* TREE_CHK */
>  
>  	/* rename directories
> @@ -1238,7 +1239,7 @@ tree_post( char *path1, char *path2 )
>  	}
>  
>  #ifdef TREE_CHK
> -	ASSERT( tree_chk( ));
> +	assert( tree_chk( ));
>  #endif /* TREE_CHK */
>  
>  	/* process hard links
> @@ -1321,7 +1322,7 @@ noref_elim_recurse( nh_t parh,
>  			if ( ! isrefpr ) {
>  				nrh_t nrh;
>  
> -				ASSERT( ! isrenamepr );
> +				assert( ! isrenamepr );
>  				if ( isrealpr ) {
>  					ok = Node2path( cldh, path1, _("rmdir") );
>  					if ( ! ok ) {
> @@ -1346,7 +1347,7 @@ noref_elim_recurse( nh_t parh,
>  					}
>  				}
>  				nrh = disown( cldh );
> -				ASSERT( nrh != NRH_NULL );
> +				assert( nrh != NRH_NULL );
>  				namreg_del( nrh );
>  				link_out( cldh );
>  				Node_free( &cldh );
> @@ -1356,8 +1357,8 @@ noref_elim_recurse( nh_t parh,
>  				nrh_t nrh;
>  				node_t *renamep;
>  
> -				ASSERT( isrefpr );
> -				ASSERT( isrealpr );
> +				assert( isrefpr );
> +				assert( isrealpr );
>  				ok = Node2path( cldh,
>  						path1,
>  						_("tmp dir rename src") );
> @@ -1366,7 +1367,7 @@ noref_elim_recurse( nh_t parh,
>  					continue;
>  				}
>  				nrh = disown( cldh );
> -				ASSERT( nrh != NRH_NULL );
> +				assert( nrh != NRH_NULL );
>  				adopt( persp->p_orphh, cldh, NRH_NULL );
>  				ok = Node2path( cldh,
>  						path2,
> @@ -1375,7 +1376,7 @@ noref_elim_recurse( nh_t parh,
>  					/* REFERENCED */
>  					nrh_t dummynrh;
>  					dummynrh = disown( cldh );
> -					ASSERT( dummynrh == NRH_NULL );
> +					assert( dummynrh == NRH_NULL );
>  					adopt( parh, cldh, nrh );
>  					cldh = nextcldh;
>  					continue;
> @@ -1395,7 +1396,7 @@ noref_elim_recurse( nh_t parh,
>  					      path2,
>  					      strerror( errno ));
>  					dummynrh = disown( cldh );
> -					ASSERT( dummynrh == NRH_NULL );
> +					assert( dummynrh == NRH_NULL );
>  					adopt( parh, cldh, nrh );
>  					cldh = nextcldh;
>  					continue;
> @@ -1436,7 +1437,7 @@ noref_elim_recurse( nh_t parh,
>  				nh_t hardh;
>  				bool_t neededpr;
>  				hardh = link_hardh( ino, gen );
> -				ASSERT( hardh != NH_NULL );
> +				assert( hardh != NH_NULL );
>  				canunlinkpr = BOOL_FALSE;
>  				neededpr = BOOL_FALSE;
>  				/* tes@sgi.com:
> @@ -1475,7 +1476,7 @@ noref_elim_recurse( nh_t parh,
>  			if ( mustorphpr ) {
>  				/* rename file to orphanage */
>  				nrh_t nrh;
> -				ASSERT( ! canunlinkpr );
> +				assert( ! canunlinkpr );
>  				ok = Node2path( cldh,
>  						path1,
>  						_("tmp nondir rename src") );
> @@ -1484,7 +1485,7 @@ noref_elim_recurse( nh_t parh,
>  					continue;
>  				}
>  				nrh = disown( cldh );
> -				ASSERT( nrh != NRH_NULL );
> +				assert( nrh != NRH_NULL );
>  				adopt( persp->p_orphh, cldh, NRH_NULL );
>  				ok = Node2path( cldh,
>  						path2,
> @@ -1493,7 +1494,7 @@ noref_elim_recurse( nh_t parh,
>  					/* REFERENCED */
>  					nrh_t dummynrh;
>  					dummynrh = disown( cldh );
> -					ASSERT( dummynrh == NRH_NULL );
> +					assert( dummynrh == NRH_NULL );
>  					adopt( parh, cldh, nrh );
>  					cldh = nextcldh;
>  					continue;
> @@ -1513,7 +1514,7 @@ noref_elim_recurse( nh_t parh,
>  					      path2,
>  					      strerror( errno ));
>  					dummynrh = disown( cldh );
> -					ASSERT( dummynrh == NRH_NULL );
> +					assert( dummynrh == NRH_NULL );
>  					adopt( parh, cldh, nrh );
>  					cldh = nextcldh;
>  					continue;
> @@ -1527,7 +1528,7 @@ noref_elim_recurse( nh_t parh,
>  				/* REFERENCED */
>  				nrh_t nrh;
>  
> -				ASSERT( ! mustorphpr );
> +				assert( ! mustorphpr );
>  				if ( isrealpr ) {
>  					ok = Node2path( cldh, path1, _("rmdir") );
>  					if ( ! ok ) {
> @@ -1553,7 +1554,7 @@ noref_elim_recurse( nh_t parh,
>  					}
>  				}
>  				nrh = disown( cldh );
> -				ASSERT( nrh != NRH_NULL );
> +				assert( nrh != NRH_NULL );
>  				link_out( cldh );
>  				Node_free( &cldh );
>  			}
> @@ -1662,7 +1663,7 @@ rename_dirs( nh_t cldh,
>  		isrenamepr = isdirpr && renameh != NH_NULL;
>  		nextcldh = cldp->n_sibh;
>  		Node_unmap( cldh, &cldp );
> -		ASSERT( parh == persp->p_orphh );
> +		assert( parh == persp->p_orphh );
>  
>  		if ( isrenamepr ) {
>  			node_t *renamep;
> @@ -1681,12 +1682,12 @@ rename_dirs( nh_t cldh,
>  				continue;
>  			}
>  			dummynrh = disown( cldh );
> -			ASSERT( dummynrh == NRH_NULL );
> +			assert( dummynrh == NRH_NULL );
>  			adopt( newparh, cldh, newnrh );
>  			ok = Node2path( cldh, path2, _("rename dir") );
>  			if ( ! ok ) {
>  				dummynrh = disown( cldh );
> -				ASSERT( dummynrh == newnrh );
> +				assert( dummynrh == newnrh );
>  				adopt( persp->p_orphh, cldh, NRH_NULL );
>  				cldp = Node_map( cldh );
>  				cldp->n_nrh = NRH_NULL;
> @@ -1707,7 +1708,7 @@ rename_dirs( nh_t cldh,
>  				      path2,
>  				      strerror( errno ));
>  				dummynrh = disown( cldh );
> -				ASSERT( dummynrh == newnrh );
> +				assert( dummynrh == newnrh );
>  				adopt( persp->p_orphh, cldh, NRH_NULL );
>  				cldh = nextcldh;
>  				continue;
> @@ -1964,7 +1965,7 @@ tree_cb_links( xfs_ino_t ino,
>  			link_in( nh );
>  			adopt( persp->p_orphh, nh, NRH_NULL );
>  			ok = Node2path( nh, path1, _("orphan") );
> -			ASSERT( ok );
> +			assert( ok );
>  			( void )( * funcp )( contextp, BOOL_FALSE, path1,path2);
>  		}
>  	}
> @@ -2271,7 +2272,7 @@ proc_hardlinks_cb( void *contextp, nh_t hardheadh )
>  			}
>  			continue;
>  		}
> -		ASSERT( 0 );
> +		assert( 0 );
>  	}
>  
>  	/* now pass through dst list, doing renames if src list not empty,
> @@ -2700,7 +2701,7 @@ restart:
>  	preamblestr[ preamblecnt++ ] = "\n";
>  	preamblestr[ preamblecnt++ ] = fold;
>  	preamblestr[ preamblecnt++ ] = "\n\n";
> -	ASSERT( preamblecnt <= PREAMBLEMAX );
> +	assert( preamblecnt <= PREAMBLEMAX );
>  	dlog_begin( preamblestr, preamblecnt );
>  
>  	/* execute commands until time to extract or quit. always begin with
> @@ -2736,9 +2737,9 @@ restart:
>  		} else if ( responseix == abortix ) {
>  			ackstr[ ackcnt++ ] = _("abort\n");
>  		} else {
> -			ASSERT( responseix == okix );
> +			assert( responseix == okix );
>  		}
> -		ASSERT( ackcnt <= ACKMAX );
> +		assert( ackcnt <= ACKMAX );
>  		dlog_string_ack( ackstr,
>  				 ackcnt );
>  
> @@ -2753,7 +2754,7 @@ restart:
>  			postamblestr[ postamblecnt++ ] = "\n";
>  			postamblestr[ postamblecnt++ ] = fold;
>  			postamblestr[ postamblecnt++ ] = "\n\n";
> -			ASSERT( postamblecnt <= POSTAMBLEMAX );
> +			assert( postamblecnt <= POSTAMBLEMAX );
>  			dlog_end( postamblestr, postamblecnt );
>  
>  			/* if sighup or sigquit, immediately quit
> @@ -2765,7 +2766,7 @@ restart:
>  			/* if sigint, allow main thread to decide if
>  			 * operator really wants to quit
>  			 */
> -			ASSERT( responseix == sigintix );
> +			assert( responseix == sigintix );
>  			if ( cldmgr_stop_requested( )) {
>  				return BOOL_FALSE;
>  			}
> @@ -2794,7 +2795,7 @@ restart:
>  	postamblestr[ postamblecnt++ ] = "\n";
>  	postamblestr[ postamblecnt++ ] = fold;
>  	postamblestr[ postamblecnt++ ] = "\n\n";
> -	ASSERT( postamblecnt <= POSTAMBLEMAX );
> +	assert( postamblecnt <= POSTAMBLEMAX );
>  	dlog_end( postamblestr, postamblecnt );
>  
>  	/* pv 773569 - quit is not a reason to consider session
> @@ -2846,7 +2847,7 @@ tsi_cmd_pwd_recurse( void *ctxp,
>  	register intgen_t namelen;
>  	nrh_t nrh;
>  
> -	ASSERT( nh != NH_NULL );
> +	assert( nh != NH_NULL );
>  
>  	np = Node_map( nh );
>  	nrh = np->n_nrh;
> @@ -2857,11 +2858,11 @@ tsi_cmd_pwd_recurse( void *ctxp,
>  			/* RECURSION */
>  		( * pcb )( pctxp, "/" );
>  	}
> -	ASSERT( nrh != NRH_NULL );
> +	assert( nrh != NRH_NULL );
>  	namelen = namreg_get( nrh,
>  			      tranp->t_inter.i_name,
>  			      sizeof( tranp->t_inter.i_name ));
> -	ASSERT( namelen > 0 );
> +	assert( namelen > 0 );
>  	( * pcb )( pctxp, tranp->t_inter.i_name );
>  }
>  
> @@ -2933,7 +2934,7 @@ tsi_cmd_ls( void *ctxp,
>  			namelen = namreg_get( nrh,
>  					      tranp->t_inter.i_name,
>  					      sizeof( tranp->t_inter.i_name ));
> -			ASSERT( namelen > 0 );
> +			assert( namelen > 0 );
>  			( * pcb )( pctxp,
>  				   "    %s %10llu %s%s\n",
>  				   isselpr ? "*" : " ",
> @@ -2983,7 +2984,7 @@ tsi_cmd_cd( void *ctxp,
>  	/* if named is not a dir, complain
>  	 */
>  	if ( ! isdirpr ) {
> -		ASSERT( arg );
> +		assert( arg );
>  		( * pcb )( pctxp,
>  			   _("%s is not a directory\n"),
>  			   arg );
> @@ -3152,7 +3153,7 @@ tsi_cmd_match( void )
>  		return 0;
>  	}
>  
> -	ASSERT( tblp->tct_argcmin != 0 );
> +	assert( tblp->tct_argcmin != 0 );
>  	if ( tranp->t_inter.i_argc < tblp->tct_argcmin ) {
>  		return 0;
>  	}
> @@ -3224,11 +3225,11 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
>  	 * or at the current working directory
>  	 */
>  	if ( path && *path == '/' ) {
> -		ASSERT( rooth != NH_NULL );
> +		assert( rooth != NH_NULL );
>  		namedh = rooth;
>  		path++;
>  	} else {
> -		ASSERT( cwdh != NH_NULL );
> +		assert( cwdh != NH_NULL );
>  		namedh = cwdh;
>  	}
>  
> @@ -3239,7 +3240,7 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
>  	cldh = namedp->n_cldh;
>  	ino = namedp->n_ino;
>  	isselpr = ( namedp->n_flags & NF_SUBTREE );
> -	ASSERT( namedp->n_flags & NF_ISDIR );
> +	assert( namedp->n_flags & NF_ISDIR );
>  	Node_unmap( namedh, &namedp );
>  	isdirpr = BOOL_TRUE;
>  
> @@ -3278,12 +3279,12 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
>  		 * the path pointer.
>  		 */
>  		namelen = strcspn( path, "/" );
> -		ASSERT( namelen < sizeof( nbuf ));
> +		assert( namelen < sizeof( nbuf ));
>  		strncpy( nbuf, path, namelen );
>  		nbuf[ namelen ] = 0;
>  		path += namelen;
>  		if ( *path ) {
> -			ASSERT( *path == '/' );
> +			assert( *path == '/' );
>  			strpatchp = path;
>  			*strpatchp = 0;
>  			path++;
> @@ -3353,12 +3354,12 @@ tsi_walkpath( char *arg, nh_t rooth, nh_t cwdh,
>  			isselpr = ( sibp->n_flags & NF_SUBTREE );
>  			isdirpr = ( sibp->n_flags & NF_ISDIR );
>  			Node_unmap( sibh, &sibp );
> -			ASSERT( nrh != NRH_NULL || sibh == persp->p_orphh );
> +			assert( nrh != NRH_NULL || sibh == persp->p_orphh );
>  			if ( nrh != NRH_NULL ) {
>  				siblen = namreg_get( nrh,
>  						     tranp->t_inter.i_name,
>  					       sizeof( tranp->t_inter.i_name ));
> -				ASSERT( siblen > 0 );
> +				assert( siblen > 0 );
>  				if ( ! strcmp( nbuf, tranp->t_inter.i_name )) {
>  					break;
>  				}
> @@ -3523,7 +3524,7 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
>  	/* if we have a cache hit, no need to recurse any further
>  	 */
>  	if ( nh == cache.nh ) {
> -		ASSERT( bufsz > cache.len );
> +		assert( bufsz > cache.len );
>  		strcpy( buf, cache.buf );
>  		return bufsz - cache.len;
>  	}
> @@ -3550,7 +3551,7 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
>  	/* insert slash if parent not root
>  	 */
>  	if ( parh != persp->p_rooth ) {
> -		ASSERT( bufsz + MAXPATHLEN >= 2 );
> +		assert( bufsz + MAXPATHLEN >= 2 );
>  		*buf++ = '/';
>  		*( buf + 1 ) = 0;
>  		bufsz--;
> @@ -3566,15 +3567,15 @@ Node2path_recurse( nh_t nh, char *buf, intgen_t bufsz, intgen_t level )
>  	} else if ( nh == persp->p_orphh ) {
>  		namelen = sprintf( buf, "%s", orphname );
>  	} else {
> -		ASSERT( nrh != NRH_NULL );
> +		assert( nrh != NRH_NULL );
>  		namelen = namreg_get( nrh, buf, ( size_t )bufsz + MAXPATHLEN );
> -		ASSERT( namelen > 0 );
> +		assert( namelen > 0 );
>  	}
>  
>  	/* update remaining buffer size
>  	 */
>  	bufsz -= namelen;
> -	ASSERT( bufsz + MAXPATHLEN > 0 );
> +	assert( bufsz + MAXPATHLEN > 0 );
>  
>  	/* update the cache if we're the target's parent
>  	 * (and the pathname is not too long)
> @@ -3639,7 +3640,7 @@ disown( nh_t cldh )
>  	nrh = cldp->n_nrh;
>  
>  	parh = cldp->n_parh;
> -	ASSERT( parh != NH_NULL );
> +	assert( parh != NH_NULL );
>  	if ( parh == NH_NULL ) {
>  		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
>  		      "attempt to disown child "
> @@ -3647,7 +3648,7 @@ disown( nh_t cldh )
>  		return nrh;
>  	}
>  	parp = Node_map( parh );
> -	ASSERT( parp->n_cldh != NH_NULL );
> +	assert( parp->n_cldh != NH_NULL );
>  	if ( parp->n_cldh == NH_NULL ) {
>  		mlog( MLOG_NORMAL | MLOG_WARNING | MLOG_TREE, _(
>  		      "attempt to disown child "
> @@ -3668,7 +3669,7 @@ disown( nh_t cldh )
>  		nh_t prevcldh = cldp->n_sibprevh;
>  		node_t *prevcldp;
>  
> -		ASSERT(prevcldh != NH_NULL); /* must be a previous */
> +		assert(prevcldh != NH_NULL); /* must be a previous */
>  		prevcldp = Node_map( prevcldh );
>  
>  		/* fix up previous */
> @@ -3865,7 +3866,7 @@ link_matchh( nh_t hardh, nh_t parh, char *name )
>  			namelen = namreg_get( np->n_nrh,
>  					      tranp->t_namebuf,
>  					      sizeof( tranp->t_namebuf ));
> -			ASSERT( namelen > 0 );
> +			assert( namelen > 0 );
>  			if ( ! strcmp( name, tranp->t_namebuf )) {
>  				Node_unmap( hardh, &np );
>  				break;
> @@ -3955,7 +3956,7 @@ link_out( nh_t nh )
>  	/* get head of hard link list
>  	 */
>  	hardh = hash_find( ino, gen );
> -	ASSERT( hardh != NH_NULL );
> +	assert( hardh != NH_NULL );
>  
>  	/* if node is at head of hard link list, hash it out and
>  	 * hash in the following node in link list, if there is one.
> @@ -3973,7 +3974,7 @@ link_out( nh_t nh )
>  			nh_t nexth = prevp->n_lnkh;
>  			Node_unmap( prevh, &prevp  );
>  			prevh = nexth;
> -			ASSERT( prevh != NH_NULL );
> +			assert( prevh != NH_NULL );
>  			prevp = Node_map( prevh );
>  		}
>  		prevp->n_lnkh = np->n_lnkh;
> @@ -4033,7 +4034,7 @@ link_iter_next( link_iter_context_t *link_iter_contextp )
>  	/* if no last, must be first call
>  	 */
>  	if ( tmplasth == NH_NULL ) {
> -		ASSERT( link_iter_contextp->li_prevh == NH_NULL );
> +		assert( link_iter_contextp->li_prevh == NH_NULL );
>  		link_iter_contextp->li_lasth = link_iter_contextp->li_headh;
>  		return link_iter_contextp->li_lasth;
>  	}
> @@ -4065,8 +4066,8 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( link_iter_contextp->li_lasth != NH_NULL );
> -	ASSERT( nh == link_iter_contextp->li_lasth );
> +	assert( link_iter_contextp->li_lasth != NH_NULL );
> +	assert( nh == link_iter_contextp->li_lasth );
>  
>  	/* get the next node in list
>  	 */
> @@ -4076,7 +4077,7 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
>  	Node_unmap( link_iter_contextp->li_lasth, &lastp );
>  
>  	if ( link_iter_contextp->li_lasth == link_iter_contextp->li_headh ) {
> -		ASSERT( link_iter_contextp->li_prevh == NH_NULL );
> +		assert( link_iter_contextp->li_prevh == NH_NULL );
>  		hash_out( link_iter_contextp->li_headh );
>  		link_iter_contextp->li_headh = nexth;
>  		if ( nexth != NH_NULL ) {
> @@ -4084,7 +4085,7 @@ link_iter_unlink( link_iter_context_t *link_iter_contextp, nh_t nh )
>  		}
>  	} else {
>  		node_t *prevp;
> -		ASSERT( link_iter_contextp->li_prevh != NH_NULL );
> +		assert( link_iter_contextp->li_prevh != NH_NULL );
>  		prevp = Node_map( link_iter_contextp->li_prevh );
>  		prevp->n_lnkh = nexth;
>  		Node_unmap( link_iter_contextp->li_prevh, &prevp );
> @@ -4112,7 +4113,7 @@ hash_init( size64_t vmsz,
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( pgsz % sizeof( nh_t ) == 0 );
> +	assert( pgsz % sizeof( nh_t ) == 0 );
>  
>  	/* calculate the size of the hash array. must be a power of two,
>  	 * and a multiple of the page size. don't use more than the available
> @@ -4130,11 +4131,11 @@ hash_init( size64_t vmsz,
>  	      ;
>  	      loghashlen++ )
>  		;
> -	ASSERT( loghashlen > 0 );
> +	assert( loghashlen > 0 );
>  	hashlen = ( size64_t )1 << loghashlen;
>  	if (hashlen > hashlenmax)
>  		hashlen >>= 1;
> -	ASSERT( hashlen <= hashlenmax );
> +	assert( hashlen <= hashlenmax );
>  
>  	/* record hash size in persistent state
>  	 */
> @@ -4142,9 +4143,9 @@ hash_init( size64_t vmsz,
>  
>  	/* map the hash array just after the persistent state header
>  	 */
> -	ASSERT( persp->p_hashsz <= SIZEMAX );
> -	ASSERT( ! ( persp->p_hashsz % ( size64_t )pgsz ));
> -	ASSERT( ! ( PERSSZ % pgsz ));
> +	assert( persp->p_hashsz <= SIZEMAX );
> +	assert( ! ( persp->p_hashsz % ( size64_t )pgsz ));
> +	assert( ! ( PERSSZ % pgsz ));
>  	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
>  					    ( size_t )persp->p_hashsz,
>  					    tranp->t_persfd,
> @@ -4166,7 +4167,7 @@ hash_init( size64_t vmsz,
>  	/* build a hash mask. this works because hashlen is a power of two.
>  	 * record in persistent state.
>  	 */
> -	ASSERT( hashlen - 1 <= SIZEMAX );
> +	assert( hashlen - 1 <= SIZEMAX );
>  	persp->p_hashmask = ( size_t )( hashlen - 1 );
>  
>  	return BOOL_TRUE;
> @@ -4179,18 +4180,18 @@ hash_sync( char *perspath )
>  
>  	/* sanity checks
>  	 */
> -	ASSERT( pgsz % sizeof( nh_t ) == 0 );
> +	assert( pgsz % sizeof( nh_t ) == 0 );
>  
>  	/* retrieve the hash size from the persistent state
>  	 */
>  	hashsz = persp->p_hashsz;
> -	ASSERT( ! ( hashsz % sizeof( nh_t )));
> +	assert( ! ( hashsz % sizeof( nh_t )));
>  
>  	/* map the hash array just after the persistent state header
>  	 */
> -	ASSERT( hashsz <= SIZEMAX );
> -	ASSERT( ! ( hashsz % ( size64_t )pgsz ));
> -	ASSERT( ! ( PERSSZ % pgsz ));
> +	assert( hashsz <= SIZEMAX );
> +	assert( ! ( hashsz % ( size64_t )pgsz ));
> +	assert( ! ( PERSSZ % pgsz ));
>  	tranp->t_hashp = ( nh_t * ) mmap_autogrow(
>  					    ( size_t )hashsz,
>  					    tranp->t_persfd,
> @@ -4236,7 +4237,7 @@ hash_in( nh_t nh )
>  	
>  	/* assert not already in
>  	 */
> -	ASSERT( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
> +	assert( hash_find( np->n_ino, np->n_gen ) == NH_NULL );
>  
>  	/* calculate the hash index
>  	 */
> @@ -4248,7 +4249,7 @@ hash_in( nh_t nh )
>  
>  	/* insert into the list, at the head
>  	 */
> -	ASSERT( np->n_hashh == NH_NULL );
> +	assert( np->n_hashh == NH_NULL );
>  	np->n_hashh = *entryp;
>  	*entryp = nh;
>  
> @@ -4282,7 +4283,7 @@ hash_out( nh_t nh )
>  	/* get the handle of the first node in the appropriate hash array
>  	 */
>  	hashheadh = *entryp;
> -	ASSERT( hashheadh != NH_NULL );
> +	assert( hashheadh != NH_NULL );
>  	
>  	/* if node is first in list, replace entry with following node.
>  	 * otherwise, walk the list until found.
> @@ -4296,7 +4297,7 @@ hash_out( nh_t nh )
>  			nh_t nexth = prevp->n_hashh;
>  			Node_unmap( prevh, &prevp  );
>  			prevh = nexth;
> -			ASSERT( prevh != NH_NULL );
> +			assert( prevh != NH_NULL );
>  			prevp = Node_map( prevh );
>  		}
>  		prevp->n_hashh = np->n_hashh;
> @@ -4412,11 +4413,11 @@ Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
>  		*nexthashhp = NH_NULL;
>  	}
>  
> -	ASSERT( nextlnkhp );
> +	assert( nextlnkhp );
>  	*nextlnkhp = NH_NULL;
>  
>  	np = Node_map( nh );
> -	ASSERT( np );
> +	assert( np );
>  	n = *np;
>  	Node_unmap( nh, &np );
>  
> @@ -4456,7 +4457,7 @@ Node_chk( nh_t nh, nh_t *nexthashhp, nh_t *nextlnkhp )
>  	if ( n.n_nrh != NRH_NULL ) {
>  		intgen_t rval;
>  		rval = namreg_get( n.n_nrh, nambuf, sizeof( nambuf ));
> -		ASSERT( rval >= 0 );
> +		assert( rval >= 0 );
>  	}
>  
>  	if ( n.n_dah != DAH_NULL ) {
> @@ -4539,7 +4540,7 @@ tree_chk2_recurse( nh_t cldh, nh_t parh )
>  {
>  	bool_t okaccum = BOOL_TRUE;
>  
> -	ASSERT( parh != NH_NULL );
> +	assert( parh != NH_NULL );
>  
>  	while ( cldh != NH_NULL ) {
>  		node_t *cldp;
> @@ -4569,7 +4570,7 @@ tree_chk2_recurse( nh_t cldh, nh_t parh )
>  			namelen = namreg_get( nrh,
>  					      tranp->t_namebuf,
>  					      sizeof( tranp->t_namebuf ));
> -			ASSERT( namelen >= 0 );
> +			assert( namelen >= 0 );
>  		}
>  
>  		if ( nodeparh == NH_NULL ) {
> @@ -4631,7 +4632,7 @@ parse( int slotcnt, char **slotbuf, char *string )
>  
>  	/* sanity checkcs
>  	 */
> -	ASSERT( slotcnt >= 0 );
> +	assert( slotcnt >= 0 );
>  
>  	/* allocate a companion to the input string for identifying
>  	 * characters which are to be interpreted literally.
> diff --git a/restore/win.c b/restore/win.c
> index 0f3b573..a9f0239 100644
> --- a/restore/win.c
> +++ b/restore/win.c
> @@ -25,6 +25,7 @@
>  #include <stdlib.h>
>  #include <memory.h>
>  #include <errno.h>
> +#include <assert.h>
>  
>  #include "types.h"
>  #include "mlog.h"
> @@ -153,14 +154,14 @@ win_init( intgen_t fd,
>  {
>  	/* validate parameters
>  	 */
> -	ASSERT( ( firstoff & ( off64_t )pgmask ) == 0 );
> -	ASSERT( ( segsz & pgmask ) == 0 );
> +	assert( ( firstoff & ( off64_t )pgmask ) == 0 );
> +	assert( ( segsz & pgmask ) == 0 );
>  
>  	/* allocate and initialize transient state
>  	 */
> -	ASSERT( tranp == 0 );
> +	assert( tranp == 0 );
>  	tranp = ( tran_t * )calloc( 1, sizeof( tran_t ));
> -	ASSERT( tranp );
> +	assert( tranp );
>  
>  	tranp->t_fd = fd;
>  	tranp->t_firstoff = firstoff;
> @@ -170,7 +171,7 @@ win_init( intgen_t fd,
>  	tranp->t_segmaplen = SEGMAP_INCR;
>  	tranp->t_segmap = (win_t **)
>  	calloc( tranp->t_segmaplen, sizeof(win_t *) );
> -	ASSERT( tranp->t_segmap );
> +	assert( tranp->t_segmap );
>  
>  	/* initialize critical region enforcer
>  	 */
> @@ -203,8 +204,8 @@ win_map( segix_t segix, void **pp )
>  		     "win_map(): requested segment already mapped\n");
>  #endif
>  		if ( winp->w_refcnt == 0 ) {
> -			ASSERT( tranp->t_lruheadp );
> -			ASSERT( tranp->t_lrutailp );
> +			assert( tranp->t_lruheadp );
> +			assert( tranp->t_lrutailp );
>  			if ( tranp->t_lruheadp == winp ) {
>  				if ( tranp->t_lrutailp == winp ) {
>  					tranp->t_lruheadp = 0;
> @@ -225,8 +226,8 @@ win_map( segix_t segix, void **pp )
>  			winp->w_prevp = 0;
>  			winp->w_nextp = 0;
>  		} else {
> -			ASSERT( ! winp->w_prevp );
> -			ASSERT( ! winp->w_nextp );
> +			assert( ! winp->w_prevp );
> +			assert( ! winp->w_nextp );
>  		}
>  		winp->w_refcnt++;
>  		*pp = winp->w_p;
> @@ -243,7 +244,7 @@ win_map( segix_t segix, void **pp )
>  		     "win_map(): create a new window\n");
>  #endif
>  		winp = ( win_t * )calloc( 1, sizeof( win_t ));
> -		ASSERT( winp );
> +		assert( winp );
>  		tranp->t_wincnt++;
>  	} else if ( tranp->t_lruheadp ) {
>  		/* REFERENCED */
> @@ -252,7 +253,7 @@ win_map( segix_t segix, void **pp )
>  		mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
>  		     "win_map(): get head from lru freelist & unmap\n");
>  #endif
> -		ASSERT( tranp->t_lrutailp );
> +		assert( tranp->t_lrutailp );
>  		winp = tranp->t_lruheadp;
>  		tranp->t_lruheadp = winp->w_nextp;
>  		if ( tranp->t_lruheadp ) {
> @@ -262,10 +263,10 @@ win_map( segix_t segix, void **pp )
>  		}
>  		tranp->t_segmap[winp->w_segix] = NULL;
>  		rval = munmap( winp->w_p, tranp->t_segsz );
> -		ASSERT( ! rval );
> +		assert( ! rval );
>  		memset( ( void * )winp, 0, sizeof( win_t ));
>  	} else {
> -		ASSERT( tranp->t_wincnt == tranp->t_winmax );
> +		assert( tranp->t_wincnt == tranp->t_winmax );
>  		*pp = NULL;
>  		CRITICAL_END();
>  		mlog( MLOG_NORMAL | MLOG_WARNING, _(
> @@ -279,12 +280,12 @@ win_map( segix_t segix, void **pp )
>  
>  	/* map the window
>  	 */
> -	ASSERT( tranp->t_segsz >= 1 );
> -	ASSERT( tranp->t_firstoff
> +	assert( tranp->t_segsz >= 1 );
> +	assert( tranp->t_firstoff
>  		<=
>  		OFF64MAX - segoff - ( off64_t )tranp->t_segsz + 1ll );
> -	ASSERT( ! ( tranp->t_segsz % pgsz ));
> -	ASSERT( ! ( ( tranp->t_firstoff + segoff ) % ( off64_t )pgsz ));
> +	assert( ! ( tranp->t_segsz % pgsz ));
> +	assert( ! ( ( tranp->t_firstoff + segoff ) % ( off64_t )pgsz ));
>  #ifdef TREE_DEBUG
>  	mlog(MLOG_DEBUG | MLOG_TREE | MLOG_NOLOCK,
>  	     "win_map(): mmap segment at %lld, size = %llu\n",
> @@ -317,7 +318,7 @@ win_map( segix_t segix, void **pp )
>  		return;
>  	}
>  	winp->w_segix  = segix;
> -	ASSERT( winp->w_refcnt == 0 );
> +	assert( winp->w_refcnt == 0 );
>  	winp->w_refcnt++;
>  	tranp->t_segmap[winp->w_segix] = winp;
>  
> @@ -335,36 +336,36 @@ win_unmap( segix_t segix, void **pp )
>  
>  	/* verify window mapped
>  	 */
> -	ASSERT( segix < tranp->t_segmaplen );
> +	assert( segix < tranp->t_segmaplen );
>  	winp = tranp->t_segmap[segix];
> -	ASSERT( winp );
> +	assert( winp );
>  
>  	/* validate p
>  	 */
> -	ASSERT( pp );
> -	ASSERT( *pp );
> -	ASSERT( *pp >= winp->w_p );
> -	ASSERT( *pp < ( void * )( ( char * )( winp->w_p ) + tranp->t_segsz ));
> +	assert( pp );
> +	assert( *pp );
> +	assert( *pp >= winp->w_p );
> +	assert( *pp < ( void * )( ( char * )( winp->w_p ) + tranp->t_segsz ));
>  
>  	/* decrement the reference count. if zero, place at tail of LRU list.
>  	 */
> -	ASSERT( winp->w_refcnt > 0 );
> +	assert( winp->w_refcnt > 0 );
>  	winp->w_refcnt--;
> -	ASSERT( ! winp->w_prevp );
> -	ASSERT( ! winp->w_nextp );
> +	assert( ! winp->w_prevp );
> +	assert( ! winp->w_nextp );
>  	if ( winp->w_refcnt == 0 ) {
>  		if ( tranp->t_lrutailp ) {
> -			ASSERT( tranp->t_lruheadp );
> +			assert( tranp->t_lruheadp );
>  			winp->w_prevp = tranp->t_lrutailp;
>  			tranp->t_lrutailp->w_nextp = winp;
>  			tranp->t_lrutailp = winp;
>  		} else {
> -			ASSERT( ! tranp->t_lruheadp );
> -			ASSERT( ! winp->w_prevp );
> +			assert( ! tranp->t_lruheadp );
> +			assert( ! winp->w_prevp );
>  			tranp->t_lruheadp = winp;
>  			tranp->t_lrutailp = winp;
>  		}
> -		ASSERT( ! winp->w_nextp );
> +		assert( ! winp->w_nextp );
>  	}
>  
>  	/* zero the caller's pointer
> @@ -385,7 +386,7 @@ win_segmap_resize(segix_t segix)
>  	tranp->t_segmaplen = segix + SEGMAP_INCR;
>  	tranp->t_segmap = (win_t **)
>  		realloc( tranp->t_segmap, tranp->t_segmaplen * sizeof(win_t *) );
> -	ASSERT( tranp->t_segmap );
> +	assert( tranp->t_segmap );
>  
>  	/* clear the new portion of the array */
>  	new_part = tranp->t_segmap + oldlen;
> -- 
> 2.5.0
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes!
  2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
                   ` (7 preceding siblings ...)
  2015-10-16  1:45 ` [PATCH 8/8] cleanup: Kill unnecessary xfs includes Dave Chinner
@ 2015-10-28 11:51 ` Brian Foster
  2015-10-28 22:35   ` Dave Chinner
  8 siblings, 1 reply; 17+ messages in thread
From: Brian Foster @ 2015-10-28 11:51 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Fri, Oct 16, 2015 at 12:44:53PM +1100, Dave Chinner wrote:
> Hi folks,
> 
> Turns out that changes to exported XFS headers in xfsprogs v4.2.0
> broke the xfsdump build. the XFS dump build was implicitly including
> the platform definitions calculated for the xfsprogs build and so
> removing them from the xfsprogs headers made xfsdump very unhappy.
> 
...
> 
> So, now the code base is a little bit cleaner, a lot less dependent
> on the xfsprogs header files, compiles cleanly on xfsprogs 3.2.x and
> 4.x releases, can easily have asserts build in or excluded (distro
> packages need to use "export DEBUG=-DNDEBUG" to exclude asserts),
> passes xfstests with asserts enabled and disabled, and best of all
> the source code is a little less eye-bleedy.
> 
> I really don't expect anyone to review this closely - it's *huge*
> chunk of boring search/replace change:
> 
>  94 files changed, 2929 insertions(+), 2652 deletions(-)
> 
> but I would like people to comment on/ack the approach I've taken
> here. If nobody objects/cares, I'll then do a 3.1.6 release early
> next week....
> 

I sent some comments on patch 1, otherwise the rest looks reasonable to
me on a quick pass through. The only thing I noticed is that the series
introduced a handful of whitespace problems. I didn't go and track them
into the individual patches, but here's the full output from my patch
import:

Applying: cleanup: get rid of ASSERT
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:3725: space before tab in indent.
        assert( namebuf );
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5656: trailing whitespace.
        assert ( ent != NULL );
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5855: trailing whitespace.
        assert ( ent != NULL );
warning: 3 lines add whitespace errors.
Applying: build: don't rely on xfs/xfs.h to include necessary headers
Applying: cleanup: kill intgen_t
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:2018: trailing whitespace.
static int
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:3295: space before tab in indent.
                                                int fsfd,
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:6044: trailing whitespace.
                        int namebuflen;
warning: 3 lines add whitespace errors.
Applying: cleanup: kill u_int*_t types
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:255: trailing whitespace.
static uint32_t erase_and_verify( drive_t *drivep );
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:1372: trailing whitespace.
        uint             s_max_nstreams;/* number of media streams in
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:1461: trailing whitespace.
DEBUG_displayallsessions( int fd, invt_seshdr_t *hdr, uint ref,
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:1816: trailing whitespace.
        uint16_t d_sum;
warning: 4 lines add whitespace errors.
Applying: cleanup: define a local xfs_ino_t
Applying: cleanup: use system uuid.h headers
Applying: cleanup: move fold_t out of util.h
/home/bfoster/repos/xfsdump/.git/rebase-apply/patch:85: trailing whitespace.
/* flg definitions for preemptchk
warning: 1 line adds whitespace errors.
Applying: cleanup: Kill unnecessary xfs includes

Brian

> -Dave.
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-28 11:51   ` Brian Foster
@ 2015-10-28 22:32     ` Dave Chinner
  2015-10-29 12:13       ` Brian Foster
  0 siblings, 1 reply; 17+ messages in thread
From: Dave Chinner @ 2015-10-28 22:32 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Wed, Oct 28, 2015 at 07:51:22AM -0400, Brian Foster wrote:
> On Fri, Oct 16, 2015 at 12:44:54PM +1100, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > 
> > ASSERT comes from the xfs/xfs.h include, and we don't ever define
> > DEBUG so we never get asserts built in. We want asserts built in for
> > testing, but not for distro packages. The debian package already
> > tries to do this by using "export DEBUG=-DNDEBUG" for the build
> > context, but seeing as we pull in #define ASSERT(ex) (0) from the
> > XFS headers it's a no-op.
> > 
> > Convert all the ASSERT calls to assert to remove this conflict with
> > the xfsprogs headers and so local developer builds are built with
> > asserts enabled.
> > 
> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > ---
> 
> My initial concern when reading this was that asserts were now
> unconditionally enabled. According to the man page, assert() is enabled
> unless NDEBUG is defined at include time. The debian builder apparently
> does this, but is this standard for other such utils?

For other XFS utilities? Yes. For other packages I don't maintain? I
don't know, I don't care, and I don't think it's relevant at all.
How the distro builds and packages a utility is up to the distro
maintainers - if they define -NDEBUG, then there is absolutely no
change in behaviour of xfsdump. I think the binary is effectively
unchanged as assert() is defined out in that case...

> That aside, this seems like an inconsistent approach from our other
> tools. For example, the debian/rules from xfsprogs does the same thing,
> yet DEBUG must be defined to enable asserts in the first place.

That's a issue with the way xfsprogs uses asserts - ASSERT should
never have been exported in the first, nor should the xfsdump buildi
rely on it, but here we are....

> If the
> problem is that asserts cannot be enabled, I'm wondering why the
> appropriate fix isn't to define DEBUG somewhere for debug-enabled builds
> rather than unconditionally convert all of the ASSERT() calls into
> actual assert()'s..?

Becuase it has to build with both old and new xfsprogs userspace
headers. Hence we cannot use ASSERT reliably in xfsdump at all,
because it's owned by the old xfsprogs headers and it's behaviour is
determined by whatever that xfsprogs installation defined......

> We do actually have a bunch of '#ifdef DEBUG' code
> throughout xfsdump (and DEBUG appears in 'configure' as well, though I
> have no idea if that actually does anything)...

I'm not going to pull that string and have this turn into a massive
"we have to change everything" exercise. I've built the code with
and without NDEBUG enabled, and had no problems with the assert code
either way.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes!
  2015-10-28 11:51 ` [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Brian Foster
@ 2015-10-28 22:35   ` Dave Chinner
  2015-10-29 12:13     ` Brian Foster
  0 siblings, 1 reply; 17+ messages in thread
From: Dave Chinner @ 2015-10-28 22:35 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Wed, Oct 28, 2015 at 07:51:39AM -0400, Brian Foster wrote:
> On Fri, Oct 16, 2015 at 12:44:53PM +1100, Dave Chinner wrote:
> > Hi folks,
> > 
> > Turns out that changes to exported XFS headers in xfsprogs v4.2.0
> > broke the xfsdump build. the XFS dump build was implicitly including
> > the platform definitions calculated for the xfsprogs build and so
> > removing them from the xfsprogs headers made xfsdump very unhappy.
> > 
> ...
> > 
> > So, now the code base is a little bit cleaner, a lot less dependent
> > on the xfsprogs header files, compiles cleanly on xfsprogs 3.2.x and
> > 4.x releases, can easily have asserts build in or excluded (distro
> > packages need to use "export DEBUG=-DNDEBUG" to exclude asserts),
> > passes xfstests with asserts enabled and disabled, and best of all
> > the source code is a little less eye-bleedy.
> > 
> > I really don't expect anyone to review this closely - it's *huge*
> > chunk of boring search/replace change:
> > 
> >  94 files changed, 2929 insertions(+), 2652 deletions(-)
> > 
> > but I would like people to comment on/ack the approach I've taken
> > here. If nobody objects/cares, I'll then do a 3.1.6 release early
> > next week....
> > 
> 
> I sent some comments on patch 1, otherwise the rest looks reasonable to
> me on a quick pass through. The only thing I noticed is that the series
> introduced a handful of whitespace problems. I didn't go and track them
> into the individual patches, but here's the full output from my patch
> import:

it didn't add any whitespace problems...

> 
> Applying: cleanup: get rid of ASSERT
> /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:3725: space before tab in indent.
>         assert( namebuf );
> /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5656: trailing whitespace.
>         assert ( ent != NULL );
> /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5855: trailing whitespace.
>         assert ( ent != NULL );

s/ASSERT/assert/ does not change any of the whitespace, but it will
complain about it because the new line has whitespace problems
because they existed in the old line...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-28 22:32     ` Dave Chinner
@ 2015-10-29 12:13       ` Brian Foster
  2015-10-29 22:26         ` Dave Chinner
  0 siblings, 1 reply; 17+ messages in thread
From: Brian Foster @ 2015-10-29 12:13 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Thu, Oct 29, 2015 at 09:32:34AM +1100, Dave Chinner wrote:
> On Wed, Oct 28, 2015 at 07:51:22AM -0400, Brian Foster wrote:
> > On Fri, Oct 16, 2015 at 12:44:54PM +1100, Dave Chinner wrote:
> > > From: Dave Chinner <dchinner@redhat.com>
> > > 
> > > ASSERT comes from the xfs/xfs.h include, and we don't ever define
> > > DEBUG so we never get asserts built in. We want asserts built in for
> > > testing, but not for distro packages. The debian package already
> > > tries to do this by using "export DEBUG=-DNDEBUG" for the build
> > > context, but seeing as we pull in #define ASSERT(ex) (0) from the
> > > XFS headers it's a no-op.
> > > 
> > > Convert all the ASSERT calls to assert to remove this conflict with
> > > the xfsprogs headers and so local developer builds are built with
> > > asserts enabled.
> > > 
> > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > > ---
> > 
> > My initial concern when reading this was that asserts were now
> > unconditionally enabled. According to the man page, assert() is enabled
> > unless NDEBUG is defined at include time. The debian builder apparently
> > does this, but is this standard for other such utils?
> 
> For other XFS utilities? Yes. For other packages I don't maintain? I
> don't know, I don't care, and I don't think it's relevant at all.
> How the distro builds and packages a utility is up to the distro
> maintainers - if they define -NDEBUG, then there is absolutely no
> change in behaviour of xfsdump. I think the binary is effectively
> unchanged as assert() is defined out in that case...
> 

I'm talking about common packaging tools (e.g., yum/dnf being the
obvious next example) and XFS packages, not random other packages. If
they don't define NDEBUG, then apparently there is a change in behavior.

> > That aside, this seems like an inconsistent approach from our other
> > tools. For example, the debian/rules from xfsprogs does the same thing,
> > yet DEBUG must be defined to enable asserts in the first place.
> 
> That's a issue with the way xfsprogs uses asserts - ASSERT should
> never have been exported in the first, nor should the xfsdump buildi
> rely on it, but here we are....
> 

Sure...

> > If the
> > problem is that asserts cannot be enabled, I'm wondering why the
> > appropriate fix isn't to define DEBUG somewhere for debug-enabled builds
> > rather than unconditionally convert all of the ASSERT() calls into
> > actual assert()'s..?
> 
> Becuase it has to build with both old and new xfsprogs userspace
> headers. Hence we cannot use ASSERT reliably in xfsdump at all,
> because it's owned by the old xfsprogs headers and it's behaviour is
> determined by whatever that xfsprogs installation defined......
> 

Then why not try to undef/redef in xfsdump or just rename the #define
that's used? I don't care too much either way, I just don't follow why
there's a need to change behavior at all to fix a naming conflict.

Are we saying that ASSERT() probably shouldn't exist in userspace (incl.
xfsprogs) and we should always use the generic assert() mechanism? Or
are we saying ASSERT() can exist in userspace, but it's purely a libxfs
thing and should not be exported beyond that (e.g., libxfs can use
ASSERT(), actual userspace tools like repair, etc. should eventually use
assert())..? Or perhaps we want to enable assert functionality, but
DEBUG is broken (?) and we don't want to deal with that just to fix
asserts and the build? Any of those seem reasonable to me.

> > We do actually have a bunch of '#ifdef DEBUG' code
> > throughout xfsdump (and DEBUG appears in 'configure' as well, though I
> > have no idea if that actually does anything)...
> 
> I'm not going to pull that string and have this turn into a massive
> "we have to change everything" exercise. I've built the code with
> and without NDEBUG enabled, and had no problems with the assert code
> either way.
> 

I'm not sure what that has to do with fixing ASSERT(). If DEBUG is in
fact broken on xfsdump today, then it could technically be fixed
separately whenever somebody has the time and motivation to do so.

Brian

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes!
  2015-10-28 22:35   ` Dave Chinner
@ 2015-10-29 12:13     ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2015-10-29 12:13 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Thu, Oct 29, 2015 at 09:35:42AM +1100, Dave Chinner wrote:
> On Wed, Oct 28, 2015 at 07:51:39AM -0400, Brian Foster wrote:
> > On Fri, Oct 16, 2015 at 12:44:53PM +1100, Dave Chinner wrote:
> > > Hi folks,
> > > 
> > > Turns out that changes to exported XFS headers in xfsprogs v4.2.0
> > > broke the xfsdump build. the XFS dump build was implicitly including
> > > the platform definitions calculated for the xfsprogs build and so
> > > removing them from the xfsprogs headers made xfsdump very unhappy.
> > > 
> > ...
> > > 
> > > So, now the code base is a little bit cleaner, a lot less dependent
> > > on the xfsprogs header files, compiles cleanly on xfsprogs 3.2.x and
> > > 4.x releases, can easily have asserts build in or excluded (distro
> > > packages need to use "export DEBUG=-DNDEBUG" to exclude asserts),
> > > passes xfstests with asserts enabled and disabled, and best of all
> > > the source code is a little less eye-bleedy.
> > > 
> > > I really don't expect anyone to review this closely - it's *huge*
> > > chunk of boring search/replace change:
> > > 
> > >  94 files changed, 2929 insertions(+), 2652 deletions(-)
> > > 
> > > but I would like people to comment on/ack the approach I've taken
> > > here. If nobody objects/cares, I'll then do a 3.1.6 release early
> > > next week....
> > > 
> > 
> > I sent some comments on patch 1, otherwise the rest looks reasonable to
> > me on a quick pass through. The only thing I noticed is that the series
> > introduced a handful of whitespace problems. I didn't go and track them
> > into the individual patches, but here's the full output from my patch
> > import:
> 
> it didn't add any whitespace problems...
> 
> > 
> > Applying: cleanup: get rid of ASSERT
> > /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:3725: space before tab in indent.
> >         assert( namebuf );
> > /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5656: trailing whitespace.
> >         assert ( ent != NULL );
> > /home/bfoster/repos/xfsdump/.git/rebase-apply/patch:5855: trailing whitespace.
> >         assert ( ent != NULL );
> 
> s/ASSERT/assert/ does not change any of the whitespace, but it will
> complain about it because the new line has whitespace problems
> because they existed in the old line...
> 

Ok, I saw a few of them highlighted on the console after importing the
patches and for whatever reason, git highlighted the error on line
insertion but not on line removal. That made me think they were
introduced...  disregard.

Brian

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-29 12:13       ` Brian Foster
@ 2015-10-29 22:26         ` Dave Chinner
  2015-10-30 11:39           ` Brian Foster
  0 siblings, 1 reply; 17+ messages in thread
From: Dave Chinner @ 2015-10-29 22:26 UTC (permalink / raw)
  To: Brian Foster; +Cc: xfs

On Thu, Oct 29, 2015 at 08:13:34AM -0400, Brian Foster wrote:
> On Thu, Oct 29, 2015 at 09:32:34AM +1100, Dave Chinner wrote:
> > On Wed, Oct 28, 2015 at 07:51:22AM -0400, Brian Foster wrote:
> > > On Fri, Oct 16, 2015 at 12:44:54PM +1100, Dave Chinner wrote:
> > > > From: Dave Chinner <dchinner@redhat.com>
> > > > 
> > > > ASSERT comes from the xfs/xfs.h include, and we don't ever define
> > > > DEBUG so we never get asserts built in. We want asserts built in for
> > > > testing, but not for distro packages. The debian package already
> > > > tries to do this by using "export DEBUG=-DNDEBUG" for the build
> > > > context, but seeing as we pull in #define ASSERT(ex) (0) from the
> > > > XFS headers it's a no-op.
> > > > 
> > > > Convert all the ASSERT calls to assert to remove this conflict with
> > > > the xfsprogs headers and so local developer builds are built with
> > > > asserts enabled.
> > > > 
> > > > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > > > ---
> > > 
> > > My initial concern when reading this was that asserts were now
> > > unconditionally enabled. According to the man page, assert() is enabled
> > > unless NDEBUG is defined at include time. The debian builder apparently
> > > does this, but is this standard for other such utils?
> > 
> > For other XFS utilities? Yes. For other packages I don't maintain? I
> > don't know, I don't care, and I don't think it's relevant at all.
> > How the distro builds and packages a utility is up to the distro
> > maintainers - if they define -NDEBUG, then there is absolutely no
> > change in behaviour of xfsdump. I think the binary is effectively
> > unchanged as assert() is defined out in that case...
> > 
> 
> I'm talking about common packaging tools (e.g., yum/dnf being the
> obvious next example) and XFS packages, not random other packages. If
> they don't define NDEBUG, then apparently there is a change in behavior.

If they don't define that, then they've been building the packages
incorrectly... ;)

> > > If the
> > > problem is that asserts cannot be enabled, I'm wondering why the
> > > appropriate fix isn't to define DEBUG somewhere for debug-enabled builds
> > > rather than unconditionally convert all of the ASSERT() calls into
> > > actual assert()'s..?
> > 
> > Becuase it has to build with both old and new xfsprogs userspace
> > headers. Hence we cannot use ASSERT reliably in xfsdump at all,
> > because it's owned by the old xfsprogs headers and it's behaviour is
> > determined by whatever that xfsprogs installation defined......
> > 
> 
> Then why not try to undef/redef in xfsdump or just rename the #define
> that's used? I don't care too much either way, I just don't follow why
> there's a need to change behavior at all to fix a naming conflict.
> 
> Are we saying that ASSERT() probably shouldn't exist in userspace (incl.
> xfsprogs) and we should always use the generic assert() mechanism? Or
> are we saying ASSERT() can exist in userspace, but it's purely a libxfs
> thing and should not be exported beyond that (e.g., libxfs can use
> ASSERT(), actual userspace tools like repair, etc. should eventually use
> assert())..?

Precisely this. ASSERT is used in the kernel side libxfs code, and
so only exists in userspace to support the libxfs code in userspace.
We don't want the libxfs code in userspace aborting on corrupt
structures or invalid situations, because we need to
handle/parse/repair such brokenness. IOWS, the ASSERTs in libxfs/ in
userspace need to be turned off for userspace to work correctly.
That's what the DEBUG define in libxfs does.

That leads to the xfsprogs userspace still needing an assert
facility - that comes from using assert() and NDEBUG to turn it off
and on.

Essentially, ASSERT is internal to libxfs and should not be exported
anywhere. assert() should used outside libxfs in xfsprogs and other
XFS code bases.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/8] cleanup: get rid of ASSERT
  2015-10-29 22:26         ` Dave Chinner
@ 2015-10-30 11:39           ` Brian Foster
  0 siblings, 0 replies; 17+ messages in thread
From: Brian Foster @ 2015-10-30 11:39 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Fri, Oct 30, 2015 at 09:26:09AM +1100, Dave Chinner wrote:
> On Thu, Oct 29, 2015 at 08:13:34AM -0400, Brian Foster wrote:
...
> > Then why not try to undef/redef in xfsdump or just rename the #define
> > that's used? I don't care too much either way, I just don't follow why
> > there's a need to change behavior at all to fix a naming conflict.
> > 
> > Are we saying that ASSERT() probably shouldn't exist in userspace (incl.
> > xfsprogs) and we should always use the generic assert() mechanism? Or
> > are we saying ASSERT() can exist in userspace, but it's purely a libxfs
> > thing and should not be exported beyond that (e.g., libxfs can use
> > ASSERT(), actual userspace tools like repair, etc. should eventually use
> > assert())..?
> 
> Precisely this. ASSERT is used in the kernel side libxfs code, and
> so only exists in userspace to support the libxfs code in userspace.
> We don't want the libxfs code in userspace aborting on corrupt
> structures or invalid situations, because we need to
> handle/parse/repair such brokenness. IOWS, the ASSERTs in libxfs/ in
> userspace need to be turned off for userspace to work correctly.
> That's what the DEBUG define in libxfs does.
> 

Indeed.

> That leads to the xfsprogs userspace still needing an assert
> facility - that comes from using assert() and NDEBUG to turn it off
> and on.
> 
> Essentially, ASSERT is internal to libxfs and should not be exported
> anywhere. assert() should used outside libxfs in xfsprogs and other
> XFS code bases.
> 

Makes sense to me. Thanks for the explanation. It would be good if the
commit log description included some of this info. Otherwise, for the
series:

Acked-by: Brian Foster <bfoster@redhat.com>

> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-10-30 11:39 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-16  1:44 [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Dave Chinner
2015-10-16  1:44 ` [PATCH 1/8] cleanup: get rid of ASSERT Dave Chinner
2015-10-28 11:51   ` Brian Foster
2015-10-28 22:32     ` Dave Chinner
2015-10-29 12:13       ` Brian Foster
2015-10-29 22:26         ` Dave Chinner
2015-10-30 11:39           ` Brian Foster
2015-10-16  1:44 ` [PATCH 2/8] build: don't rely on xfs/xfs.h to include necessary headers Dave Chinner
2015-10-16  1:44 ` [PATCH 3/8] cleanup: kill intgen_t Dave Chinner
2015-10-16  1:44 ` [PATCH 4/8] cleanup: kill u_int*_t types Dave Chinner
2015-10-16  1:44 ` [PATCH 5/8] cleanup: define a local xfs_ino_t Dave Chinner
2015-10-16  1:44 ` [PATCH 6/8] cleanup: use system uuid.h headers Dave Chinner
2015-10-16  1:45 ` [PATCH 7/8] cleanup: move fold_t out of util.h Dave Chinner
2015-10-16  1:45 ` [PATCH 8/8] cleanup: Kill unnecessary xfs includes Dave Chinner
2015-10-28 11:51 ` [PATCH 0/8] xfsdump: Ouchie! My bleeding eyes! Brian Foster
2015-10-28 22:35   ` Dave Chinner
2015-10-29 12:13     ` Brian Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox