1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / setlabel.3c
blobdfb913dd52ad2dc870f4c98ae75d8a736494c0f4
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1998, 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 SETLABEL 3C "Dec 29, 1996"
7 .SH NAME
8 setlabel \- define the label for \fBpfmt()\fR and \fBlfmt()\fR
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <pfmt..h>
14 \fBint\fR \fBsetlabel\fR(\fBconst char *\fR\fIlabel\fR);
15 .fi
17 .SH DESCRIPTION
18 .sp
19 .LP
20 The \fBsetlabel()\fR function defines the label for messages produced in
21 standard format by subsequent calls to \fBlfmt\fR(3C) and \fBpfmt\fR(3C).
22 .sp
23 .LP
24 The \fIlabel\fR argument is a character string no more than 25 characters in
25 length.
26 .sp
27 .LP
28 No label is defined before \fBsetlabel()\fR is called. The label should be set
29 once at the beginning of a utility and remain constant. A null pointer or an
30 empty string passed as argument will reset the  definition of the label.
31 .SH RETURN VALUE
32 .sp
33 .LP
34 Upon successful completion, \fBsetlabel()\fR returns \fB0\fR; otherwise, it
35 returns a non-zero value.
36 .SH EXAMPLES
37 .sp
38 .LP
39 The following code (without previous call to \fBsetlabel()\fR):
40 .sp
41 .in +2
42 .nf
43 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\en");
44 setlabel("UX:test");
45 pfmt(stderr, MM_ERROR, "test:2:Cannot open file\en");
46 .fi
47 .in -2
49 .sp
50 .LP
51 will produce the following output:
52 .sp
53 .in +2
54 .nf
55 ERROR: Cannot open file
56 UX:test: ERROR: Cannot open file
57 .fi
58 .in -2
60 .SH ATTRIBUTES
61 .sp
62 .LP
63 See \fBattributes\fR(5) for descriptions of the following attributes:
64 .sp
66 .sp
67 .TS
68 box;
69 c | c
70 l | l .
71 ATTRIBUTE TYPE  ATTRIBUTE VALUE
73 MT-Level        MT-Safe
74 .TE
76 .SH SEE ALSO
77 .sp
78 .LP
79 \fBgetopt\fR(3C), \fBlfmt\fR(3C), \fBpfmt\fR(3C), \fBattributes\fR(5)