summaryrefslogtreecommitdiffstats
path: root/share/man/man9/alloc_unr.9
diff options
context:
space:
mode:
Diffstat (limited to 'share/man/man9/alloc_unr.9')
-rw-r--r--share/man/man9/alloc_unr.918
1 files changed, 10 insertions, 8 deletions
diff --git a/share/man/man9/alloc_unr.9 b/share/man/man9/alloc_unr.9
index 90b145d..9d81453 100644
--- a/share/man/man9/alloc_unr.9
+++ b/share/man/man9/alloc_unr.9
@@ -48,37 +48,39 @@
.Sh DESCRIPTION
The kernel unit number allocator is a generic facility, which allows to allocate
unit numbers within a specified range.
-.Bl -ohang
+.Bl -tag -width indent
.It Fn new_unrhdr low high mutex
Initialize a new unit number allocator entity.
+The
.Fa low
and
.Fa high
+arguments
specify minimum and maximum number of unit numbers.
There is no cost associated with the range of unit numbers, so unless the resource
really is finite,
-.Va INT_MAX
+.Dv INT_MAX
can be used.
If
.Fa mutex
is not
-.Va NULL ,
+.Dv NULL ,
it is used for locking when allocating and freeing units.
-Otherwise internal mutex is used.
+Otherwise, internal mutex is used.
.It Fn delete_unrhdr uh
Destroy specified unit number allocator entity.
.It Fn alloc_unr uh
Return a new unit number.
The lowest free number is always allocated.
This function does not allocate memory and never sleeps, however it may
-block on mutex.
-If no free unit numbers are left
-.Va -1
+block on a mutex.
+If no free unit numbers are left,
+.Li \-1
is returned.
.It Fn alloc_unrl uh
Same as
.Fn alloc_unr
-except that mutex is assumed to be locked already and thus is not used.
+except that mutex is assumed to be already locked and thus is not used.
.It Fn free_unr uh
Free a previously allocated unit number.
This function may require allocating memory, and thus it can sleep.
OpenPOWER on IntegriCloud