1502 Remove conversion cruft from manpages
[unleashed.git] / usr / src / man / man3c / vsyslog.3c
blob58b2c6e7555dfacebcf0302fc8088d64bb616e7d
1 '\" te
2 .\" Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH VSYSLOG 3C "Aug 30, 2006"
7 .SH NAME
8 vsyslog \- log message with a stdarg argument list
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <syslog.h>
13 #include <stdarg.h>
15 \fBvoid\fR \fBvsyslog\fR(\fBint\fR \fIpriority\fR, \fBconst char *\fR\fImessage\fR, \fBva_list\fR \fIap\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The \fBvsyslog()\fR function is identical to \fBsyslog\fR(3C), except that it
22 is called with an argument list as defined by <\fBstdarg.h\fR> rather than with
23 a variable number of arguments.
24 .SH EXAMPLES
25 .LP
26 \fBExample 1 \fRUse \fBvsyslog()\fR to write an error routine.
27 .sp
28 .LP
29 The following example demonstrates the use of \fBvsyslog()\fR in writing an
30 error routine.
32 .sp
33 .in +2
34 .nf
35 #include <syslog.h>
36 #include <stdarg.h>
39  * error should be called like:
40  *   error(pri, function_name, format, arg1, arg2...);
41  */
43 void
44 error(int pri, char *function_name, char *format, ...)
46         va_list args;
48         va_start(args, format);
49         /* log name of function causing error */
50         (void) syslog(pri, "ERROR in %s.", function_name);
51         /* log remainder of message */
52         (void) vsyslog(pri, format, args);
53         va_end(args);
54         (void) abort( );
57 main()
59         error(LOG_ERR, "main", "process %d is dying", getpid());
61 .fi
62 .in -2
64 .SH ATTRIBUTES
65 .sp
66 .LP
67 See \fBattributes\fR(5) for descriptions of the following attributes:
68 .sp
70 .sp
71 .TS
72 box;
73 c | c
74 l | l .
75 ATTRIBUTE TYPE  ATTRIBUTE VALUE
77 MT-Level        Safe
78 .TE
80 .SH SEE ALSO
81 .sp
82 .LP
83 \fBsyslog\fR(3C), \fBattributes\fR(5)