aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2001-11-26 18:37:50 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2001-11-26 18:37:50 +0000
commit57813e7f3f7f03919f5e4704c341c5961f3f316d (patch)
treeb87704c09714fef54158d9ef4303ca8484f5cc83
parent82cd5074ab947c35d1f4d67a2b878e486733097c (diff)
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
Notes
Notes: svn path=/head/; revision=86917
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/ucred.942
2 files changed, 25 insertions, 19 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 57fa586f8394..32384f5fe49d 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -219,7 +219,7 @@ MLINKS+=BUS_SETUP_INTR.9 BUS_TEARDOWN_INTR.9
MLINKS+=BUS_SETUP_INTR.9 bus_teardown_intr.9
MLINKS+=bus_generic_read_ivar.9 bus_generic_write_ivar.9
MLINKS+=ucred.9 crget.9 ucred.9 crhold.9 ucred.9 crfree.9
-MLINKS+=ucred.9 crcopy.9 ucred.9 crdup.9
+MLINKS+=ucred.9 crshared.9 ucred.9 crcopy.9 ucred.9 crdup.9
MLINKS+=mbchain.9 mb_init.9
MLINKS+=mbchain.9 mb_initm.9
diff --git a/share/man/man9/ucred.9 b/share/man/man9/ucred.9
index ec9c113fa2f1..dfc9aac20cab 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