aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9
diff options
context:
space:
mode:
authorJaakko Heinonen <jh@FreeBSD.org>2010-07-05 16:23:55 +0000
committerJaakko Heinonen <jh@FreeBSD.org>2010-07-05 16:23:55 +0000
commit13c02cbb187f4a062f9563e184dc57da661981bb (patch)
treeaa72b34baee9922e9040fa167dd3bab331b4d8cc /share/man/man9
parent45d35a30bdf4a3d73d082f0fcb1d44fcd759c2ad (diff)
downloadsrc-13c02cbb187f4a062f9563e184dc57da661981bb.tar.gz
src-13c02cbb187f4a062f9563e184dc57da661981bb.zip
Extend the kernel unit number allocator for allocating specific unit
numbers. This change adds a new function alloc_unr_specific() which returns the requested unit number if it is free. If the number is already allocated or out of the range, -1 is returned. Update alloc_unr(9) manual page accordingly and add a MLINK for alloc_unr_specific(9). Discussed on: freebsd-hackers
Notes
Notes: svn path=/head/; revision=209710
Diffstat (limited to 'share/man/man9')
-rw-r--r--share/man/man9/Makefile1
-rw-r--r--share/man/man9/alloc_unr.912
2 files changed, 12 insertions, 1 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 4e8b0cedd6f4..6e932443f031 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -374,6 +374,7 @@ MAN= accept_filter.9 \
zone.9
MLINKS= alloc_unr.9 alloc_unrl.9 \
+ alloc_unr.9 alloc_unr_specific.9 \
alloc_unr.9 delete_unrhdr.9 \
alloc_unr.9 free_unr.9 \
alloc_unr.9 new_unrhdr.9
diff --git a/share/man/man9/alloc_unr.9 b/share/man/man9/alloc_unr.9
index 2ba93e6f984e..43c145f5c7a3 100644
--- a/share/man/man9/alloc_unr.9
+++ b/share/man/man9/alloc_unr.9
@@ -24,13 +24,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 7, 2010
+.Dd July 5, 2010
.Dt ALLOC_UNR 9
.Os
.Sh NAME
.Nm new_unrhdr ,
.Nm delete_unrhdr ,
.Nm alloc_unr ,
+.Nm alloc_unr_specific ,
.Nm free_unr
.Nd "kernel unit number allocator"
.Sh SYNOPSIS
@@ -43,6 +44,8 @@
.Fn alloc_unr "struct unrhdr *uh"
.Ft int
.Fn alloc_unrl "struct unrhdr *uh"
+.Ft int
+.Fn alloc_unr_specific "struct unrhdr *uh" "u_int item"
.Ft void
.Fn free_unr "struct unrhdr *uh" "u_int item"
.Sh DESCRIPTION
@@ -81,6 +84,13 @@ is returned.
Same as
.Fn alloc_unr
except that mutex is assumed to be already locked and thus is not used.
+.It Fn alloc_unr_specific uh item
+Allocate a specific unit number.
+This function allocates memory and thus may sleep.
+The allocated unit number is returned on success.
+If the specified number is already allocated or out of the range,
+.Li \-1
+is returned.
.It Fn free_unr uh item
Free a previously allocated unit number.
This function may require allocating memory, and thus it can sleep.