1951 leaking a vdev when removing an l2cache device
[unleashed.git] / usr / src / man / man3c / door_ucred.3c
blob20aeff125015be6047442a3bf899d3be172500d7
1 '\" te
2 .\" Copyright (c) 2005, 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 DOOR_UCRED 3C "Mar 22, 2005"
7 .SH NAME
8 door_ucred \- return credential information associated with the client
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBcc\fR \fB-mt\fR [ \fIflag\fR... ] \fIfile\fR... [ \fIlibrary\fR... ]
13 #include <door.h>
15 \fBint\fR \fBdoor_ucred\fR(\fBucred_t **\fR\fIinfo\fR);
16 .fi
18 .SH DESCRIPTION
19 .sp
20 .LP
21 The  \fBdoor_ucred()\fR function returns credential information associated with
22 the client, if any, of the current door invocation.
23 .sp
24 .LP
25 When successful, \fBdoor_ucred()\fR writes a pointer to a user credential to
26 the location pointed to by \fIinfo\fR if that location was previously
27 \fINULL\fR. If that location was non-null, \fBdoor_ucred()\fR assumes that
28 \fIinfo\fR points to a previously allocated \fBucred_t\fR which is then reused.
29 The location pointed to by \fIinfo\fR can be used multiple times before being
30 freed. The value returned in \fIinfo\fR must be freed using
31 \fBucred_free\fR(3C).
32 .sp
33 .LP
34 The resulting user credential includes information about the effective user and
35 group ID, the real user and group ID, all privilege sets and the calling PID.
36 .sp
37 .LP
38 The credential information associated with the client refers to the information
39 from the immediate caller, not necessarily from the first thread in a chain of
40 door calls.
41 .SH RETURN VALUES
42 .sp
43 .LP
44 Upon successful completion, \fBdoor_ucred()\fR returns 0. Otherwise, -1 is
45 returned and \fBerrno\fR is set to indicate the error, in which case the memory
46 location pointed to by the \fIinfo\fR argument is unchanged.
47 .SH ERRORS
48 .sp
49 .LP
50 The \fBdoor_ucred()\fR function will fail if:
51 .sp
52 .ne 2
53 .na
54 \fB\fBEAGAIN\fR\fR
55 .ad
56 .RS 10n
57 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
58 sufficient to hold a ucred failed.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fBEFAULT\fR\fR
65 .ad
66 .RS 10n
67 The address of the \fIinfo\fR argument is invalid.
68 .RE
70 .sp
71 .ne 2
72 .na
73 \fB\fBEINVAL\fR\fR
74 .ad
75 .RS 10n
76 There is no associated door client.
77 .RE
79 .sp
80 .ne 2
81 .na
82 \fB\fBENOMEM\fR\fR
83 .ad
84 .RS 10n
85 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
86 sufficient to hold a ucred failed.
87 .RE
89 .SH ATTRIBUTES
90 .sp
91 .LP
92 See \fBattributes\fR(5) for descriptions of the following attributes:
93 .sp
95 .sp
96 .TS
97 box;
98 c | c
99 l | l .
100 ATTRIBUTE TYPE  ATTRIBUTE VALUE
102 Interface Stability     Stable
104 MT-Level        Safe
107 .SH SEE ALSO
110 \fBdoor_call\fR(3C), \fBdoor_create\fR(3C), \fBucred_get\fR(3C),
111 \fBattributes\fR(5)