_DIAGASSERT man page on NetBSD

Man page or keyword search:  
man Server   9087 pages
apropos Keyword Search (all sections)
Output format
NetBSD logo
[printable version]

_DIAGASSERT(3)		 BSD Library Functions Manual		_DIAGASSERT(3)

NAME
     _DIAGASSERT — expression verification macro

SYNOPSIS
     #include <assert.h>

     _DIAGASSERT(expression);

DESCRIPTION
     The _DIAGASSERT() macro tests the given expression and if it is false,
     one or more of the following may occur:

	   ·   a diagnostic message may be logged to the system logger with
	       syslog(3).  This is default behaviour.

	   ·   a diagnostic message may be printed to the stderr stream.

	   ·   the calling process will be terminated by calling abort(3).

     This behaviour may be changed by setting the LIBC_DIAGASSERT environment
     variable (see below).

     The diagnostic message consists of the text of the expression, the name
     of the source file, the line number and the enclosing function.

     If expression is true, the _DIAGASSERT() macro does nothing.

     The _DIAGASSERT() macro is not compiled in by default, and will only be
     compiled in with the cc(1) option -D_DIAGNOSTIC.

     This macro is used in the various system libraries such as the Standard
     C Library (libc, -lc) to ensure that various library calls are invoked
     with valid arguments.

ENVIRONMENT
     The LIBC_DIAGASSERT environment variable can be used to modify the
     default behaviour of logging the assertion to the system logger.

     LIBC_DIAGASSERT may be set to one or more of the following characters:

	   a	abort(3) once any assertion messages have been logged and/or
		printed.

	   A	Opposite of “a”.

	   e	Print the assertion message to the stderr stream.

	   E	Opposite of “e”.

	   l	Log the assertion message with syslog(3) to the facility
		user.debug.

	   L	Opposite of “l”.

DIAGNOSTICS
     The diagnostic message has the following format:

	   "assertion \"%s\" failed: file \"%s\", line %d, function \"%s\"\n",
		       "expression", __FILE__, __LINE__, __func__

SEE ALSO
     cc(1), abort(3), assert(3), syslog(3)

HISTORY
     The _DIAGASSERT macro appeared in NetBSD 1.5.

BSD			       January 22, 2007				   BSD
[top]
                             _         _         _ 
                            | |       | |       | |     
                            | |       | |       | |     
                         __ | | __ __ | | __ __ | | __  
                         \ \| |/ / \ \| |/ / \ \| |/ /  
                          \ \ / /   \ \ / /   \ \ / /   
                           \   /     \   /     \   /    
                            \_/       \_/       \_/ 
More information is available in HTML format for server NetBSD

List of man pages available for NetBSD

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net