summaryrefslogtreecommitdiffstats
path: root/share/man/man9/ucred.9
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2001-11-26 18:37:50 +0000
committerru <ru@FreeBSD.org>2001-11-26 18:37:50 +0000
commitbfc02ffff869ee7630c8b1eea95126bc879b4d63 (patch)
treeb87704c09714fef54158d9ef4303ca8484f5cc83 /share/man/man9/ucred.9
parenta2a1ab4a032a4994533b7022d811f79360c927e9 (diff)
downloadFreeBSD-src-bfc02ffff869ee7630c8b1eea95126bc879b4d63.zip
FreeBSD-src-bfc02ffff869ee7630c8b1eea95126bc879b4d63.tar.gz
Bring the ucred(9) manpage in sync with the source.
Specifically, document the crshared() function and fix the prototype and description of the crcopy() function. PR: docs/32275 Submitted by: Chad David <davidc@acns.ab.ca> Reviewed by: jhb
Diffstat (limited to 'share/man/man9/ucred.9')
-rw-r--r--share/man/man9/ucred.942
1 files changed, 24 insertions, 18 deletions
diff --git a/share/man/man9/ucred.9 b/share/man/man9/ucred.9
index ec9c113..dfc9aac 100644
--- a/share/man/man9/ucred.9
+++ b/share/man/man9/ucred.9
@@ -34,6 +34,7 @@
.Nm crget ,
.Nm crhold ,
.Nm crfree ,
+.Nm crshared ,
.Nm crcopy ,
.Nm crdup
.Nd "functions related to user credentials"
@@ -46,8 +47,10 @@
.Fn crhold "struct ucred *cr"
.Ft void
.Fn crfree "struct ucred *cr"
-.Ft "struct ucred *"
-.Fn crcopy "struct ucred *cr"
+.Ft int
+.Fn crshared "struct ucred *cr"
+.Ft void
+.Fn crcopy "struct ucred *dest" "struct ucred *src"
.Ft "struct ucred *"
.Fn crdup "struct ucred *cr"
.Sh DESCRIPTION
@@ -73,30 +76,33 @@ function decreases the reference count on the credential.
If the count drops to 0, the storage for the structure is freed.
.Pp
The
+.Fn crshared
+function returns true if the credential is shared.
+A credential is considered to be shared if its reference
+count is greater than one.
+.Pp
+The
.Fn crcopy
-function calls
-.Fn crdup
-to create a new structure, and copies the old credentials,
-if the reference count is greater than 1;
-otherwise, the original is returned.
+function copies the contents of the source (template)
+credential into the destination template.
+The
+.Vt uidinfo
+structure within the destination is referenced
+by calling
+.Xr uihold 9 .
.Pp
The
.Fn crdup
-function allocates memory for a new structure,
-copies the contents of the original structure
-into it, references the
-.Va cr_uidinfo
-and
-.Va cr_ruidinfo
-fields, sets the reference count
-to 1, and then returns the new structure.
+function allocates memory for a new structure and copies the
+contents of
+.Fa cr
+into it.
+The actual copying is performed by
+.Fn crcopy .
.Sh RETURN VALUES
The functions that return values all return a pointer to a
.Vt ucred
structure.
-In the case of
-.Fn crcopy ,
-the return value may be the same structure you passed to it.
.Sh SEE ALSO
.Xr uihold 9
.Sh AUTHORS
OpenPOWER on IntegriCloud