8202 doors man pages contain extra whitespace
[unleashed.git] / usr / src / man / man3c / door_ucred.3c
blobe7b471d9d5e3d8a88fac39fc4acff31724ba7134
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 .LP
20 The \fBdoor_ucred()\fR function returns credential information associated with
21 the client, if any, of the current door invocation.
22 .sp
23 .LP
24 When successful, \fBdoor_ucred()\fR writes a pointer to a user credential to
25 the location pointed to by \fIinfo\fR if that location was previously
26 \fINULL\fR. If that location was non-null, \fBdoor_ucred()\fR assumes that
27 \fIinfo\fR points to a previously allocated \fBucred_t\fR which is then reused.
28 The location pointed to by \fIinfo\fR can be used multiple times before being
29 freed. The value returned in \fIinfo\fR must be freed using
30 \fBucred_free\fR(3C).
31 .sp
32 .LP
33 The resulting user credential includes information about the effective user and
34 group ID, the real user and group ID, all privilege sets and the calling PID.
35 .sp
36 .LP
37 The credential information associated with the client refers to the information
38 from the immediate caller, not necessarily from the first thread in a chain of
39 door calls.
40 .SH RETURN VALUES
41 .LP
42 Upon successful completion, \fBdoor_ucred()\fR returns 0. Otherwise, -1 is
43 returned and \fBerrno\fR is set to indicate the error, in which case the memory
44 location pointed to by the \fIinfo\fR argument is unchanged.
45 .SH ERRORS
46 .LP
47 The \fBdoor_ucred()\fR function will fail if:
48 .sp
49 .ne 2
50 .na
51 \fB\fBEAGAIN\fR\fR
52 .ad
53 .RS 10n
54 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
55 sufficient to hold a ucred failed.
56 .RE
58 .sp
59 .ne 2
60 .na
61 \fB\fBEFAULT\fR\fR
62 .ad
63 .RS 10n
64 The address of the \fIinfo\fR argument is invalid.
65 .RE
67 .sp
68 .ne 2
69 .na
70 \fB\fBEINVAL\fR\fR
71 .ad
72 .RS 10n
73 There is no associated door client.
74 .RE
76 .sp
77 .ne 2
78 .na
79 \fB\fBENOMEM\fR\fR
80 .ad
81 .RS 10n
82 The location pointed to by \fIinfo\fR was \fINULL\fR and allocating memory
83 sufficient to hold a ucred failed.
84 .RE
86 .SH ATTRIBUTES
87 .LP
88 See \fBattributes\fR(5) for descriptions of the following attributes:
89 .sp
91 .sp
92 .TS
93 box;
94 c | c
95 l | l .
96 ATTRIBUTE TYPE  ATTRIBUTE VALUE
98 Interface Stability     Stable
100 MT-Level        Safe
103 .SH SEE ALSO
105 \fBdoor_call\fR(3C), \fBdoor_create\fR(3C), \fBucred_get\fR(3C),
106 \fBattributes\fR(5)