vsyslog man page on SmartOS

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

VSYSLOG(3C)							   VSYSLOG(3C)

NAME
       vsyslog - log message with a stdarg argument list

SYNOPSIS
       #include <syslog.h>
       #include <stdarg.h>

       void vsyslog(int priority, const char *message, va_list ap);

DESCRIPTION
       The  vsyslog()  function	 is identical to syslog(3C), except that it is
       called with an argument list as defined by <stdarg.h> rather than  with
       a variable number of arguments.

EXAMPLES
       Example 1 Use vsyslog() to write an error routine.

       The  following  example demonstrates the use of vsyslog() in writing an
       error routine.

	 #include <syslog.h>
	 #include <stdarg.h>

	 /*
	  * error should be called like:
	  *   error(pri, function_name, format, arg1, arg2...);
	  */

	 void
	 error(int pri, char *function_name, char *format, ...)
	 {
		 va_list args;

		 va_start(args, format);
		 /* log name of function causing error */
		 (void) syslog(pri, "ERROR in %s.", function_name);
		 /* log remainder of message */
		 (void) vsyslog(pri, format, args);
		 va_end(args);
		 (void) abort( );
	 }

	 main()
	 {
		 error(LOG_ERR, "main", "process %d is dying", getpid());
	 }

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       ┌───────────────┬─────────────────┐
       │ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
       ├───────────────┼─────────────────┤
       │MT-Level       │ Safe		 │
       └───────────────┴─────────────────┘

SEE ALSO
       syslog(3C), attributes(5)

				 Aug 30, 2006			   VSYSLOG(3C)
[top]

List of man pages available for SmartOS

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