View | Details | Raw Unified | Return to bug 32275
Collapse All | Expand All

(-)ucred.9 (-18 / +22 lines)
Lines 34-39 Link Here
34
.Nm crget ,
34
.Nm crget ,
35
.Nm crhold ,
35
.Nm crhold ,
36
.Nm crfree ,
36
.Nm crfree ,
37
.Nm crshared ,
37
.Nm crcopy ,
38
.Nm crcopy ,
38
.Nm crdup
39
.Nm crdup
39
.Nd "functions related to user credentials"
40
.Nd "functions related to user credentials"
Lines 46-53 Link Here
46
.Fn crhold "struct ucred *cr"
47
.Fn crhold "struct ucred *cr"
47
.Ft void
48
.Ft void
48
.Fn crfree "struct ucred *cr"
49
.Fn crfree "struct ucred *cr"
49
.Ft "struct ucred *"
50
.Ft int
50
.Fn crcopy "struct ucred *cr"
51
.Fn crshared "struct ucred *cr"
52
.Ft void
53
.Fn crcopy "struct ucred *dest" "struct ucred *src"
51
.Ft "struct ucred *"
54
.Ft "struct ucred *"
52
.Fn crdup "struct ucred *cr"
55
.Fn crdup "struct ucred *cr"
53
.Sh DESCRIPTION
56
.Sh DESCRIPTION
Lines 73-102 Link Here
73
If the count drops to 0, the storage for the structure is freed.
76
If the count drops to 0, the storage for the structure is freed.
74
.Pp
77
.Pp
75
The
78
The
79
.Fn crshared
80
function returns true if the credential is shared.
81
A credential is considered to be shared if its reference
82
count is greater then one.
83
.Pp
84
The
76
.Fn crcopy
85
.Fn crcopy
77
function calls
86
function copies the contents of the source (template)
78
.Fn crdup
87
credential into the destination template.
79
to create a new structure, and copies the old credentials,
88
The uidinfo structure within the destination is referenced
80
if the reference count is greater than 1;
89
by calling
81
otherwise, the original is returned.
90
.Fn uihold .
82
.Pp
91
.Pp
83
The
92
The
84
.Fn crdup
93
.Fn crdup
85
function allocates memory for a new structure,
94
function allocates memory for a new structure and copies the
86
copies the contents of the original structure
95
contents of
87
into it, references the
96
.Fa cr
88
.Va cr_uidinfo
97
into it.
89
and
98
The actual copying is performed by
90
.Va cr_ruidinfo
99
.Fn crcopy .
91
fields, sets the reference count
92
to 1, and then returns the new structure.
93
.Sh RETURN VALUES
100
.Sh RETURN VALUES
94
The functions that return values all return a pointer to a
101
The functions that return values all return a pointer to a
95
.Vt ucred
102
.Vt ucred
96
structure.
103
structure.
97
In the case of
98
.Fn crcopy ,
99
the return value may be the same structure you passed to it.
100
.Sh SEE ALSO
104
.Sh SEE ALSO
101
.Xr uihold 9
105
.Xr uihold 9
102
.Sh AUTHORS
106
.Sh AUTHORS

Return to bug 32275