Fix Nd; use In instead of Fd; grammar fixes.
This commit is contained in:
parent
328ce86893
commit
0e9a92473d
|
@ -1,4 +1,4 @@
|
||||||
.\" $NetBSD: randomid.3,v 1.1 2003/09/09 22:10:34 itojun Exp $
|
.\" $NetBSD: randomid.3,v 1.2 2003/09/10 09:16:45 wiz Exp $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (C) 2003 WIDE Project.
|
.\" Copyright (C) 2003 WIDE Project.
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
|
@ -34,10 +34,10 @@
|
||||||
.Nm randomid
|
.Nm randomid
|
||||||
.Nm randomid_new ,
|
.Nm randomid_new ,
|
||||||
.Nm randomid_delete ,
|
.Nm randomid_delete ,
|
||||||
.Nd make a copy of a struct passwd
|
.Nd provide pseudo-random data stream without repetitions
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Fd #include <sys/types.h>
|
.In sys/types.h
|
||||||
.Fd #include <randomid.h>
|
.In randomid.h
|
||||||
.Ft u_int32_t
|
.Ft u_int32_t
|
||||||
.Fn randomid "randomid_t ctx"
|
.Fn randomid "randomid_t ctx"
|
||||||
.Ft randomid_t
|
.Ft randomid_t
|
||||||
|
@ -53,30 +53,29 @@ a certain duration.
|
||||||
.Fa ctx
|
.Fa ctx
|
||||||
is the context which holds internal state for the random number generator.
|
is the context which holds internal state for the random number generator.
|
||||||
.Pp
|
.Pp
|
||||||
To initialize context
|
To initialize a context,
|
||||||
.Fa randomid_new
|
.Fa randomid_new
|
||||||
is used.
|
is used.
|
||||||
.Fa bits
|
.Fa bits
|
||||||
specifies the bitwidth of value generated by
|
specifies the bitwidth of the value generated by
|
||||||
.Fn randomid .
|
.Fn randomid .
|
||||||
Currently 32, 20 and 16 are supported.
|
Currently 32, 20, and 16 are supported.
|
||||||
.Fa timeo
|
.Fa timeo
|
||||||
specifies reinitialization interval in seconds.
|
specifies the reinitialization interval in seconds.
|
||||||
.Fa timeo
|
.Fa timeo
|
||||||
has to be bigger than
|
has to be bigger than
|
||||||
.Dv RANDOMID_TIMEO_MIN .
|
.Dv RANDOMID_TIMEO_MIN .
|
||||||
Return value of
|
|
||||||
.Fa randomid_new
|
.Fa randomid_new
|
||||||
is a dynamically-allocated memory region allocated by
|
returns a dynamically-allocated memory region allocated by
|
||||||
.Xr malloc 3 .
|
.Xr malloc 3 .
|
||||||
.Pp
|
.Pp
|
||||||
.Fn randomid_delete
|
.Fn randomid_delete
|
||||||
will
|
will
|
||||||
.Xr free 3
|
.Xr free 3
|
||||||
the internal state,
|
the internal state
|
||||||
.Fa ctx .
|
.Fa ctx .
|
||||||
.Pp
|
.Pp
|
||||||
Same number may appear after two reinitialization events of the internal state,
|
The same number may appear after two reinitialization events of the internal state,
|
||||||
.Fa ctx .
|
.Fa ctx .
|
||||||
Reinitialization happens when the random number generator cycle is exhausted,
|
Reinitialization happens when the random number generator cycle is exhausted,
|
||||||
or
|
or
|
||||||
|
@ -92,7 +91,7 @@ or after
|
||||||
.Fa timeo
|
.Fa timeo
|
||||||
seconds
|
seconds
|
||||||
.Pc ,
|
.Pc ,
|
||||||
therefore same data will not appear until after 36000 calls to
|
therefore the same data will not appear until after 36000 calls to
|
||||||
.Fn randomid
|
.Fn randomid
|
||||||
.Po
|
.Po
|
||||||
or after 2 times
|
or after 2 times
|
||||||
|
@ -111,8 +110,8 @@ It must not be shared among multiple data streams with different usage.
|
||||||
.\"
|
.\"
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
#include <sys/types.h>
|
#include \*[Lt]sys/types.h\*[Gt]
|
||||||
#include <randomid.h>
|
#include \*[Lt]randomid.h\*[Gt]
|
||||||
|
|
||||||
u_int32_t
|
u_int32_t
|
||||||
genid(void)
|
genid(void)
|
||||||
|
@ -129,7 +128,7 @@ genid(void)
|
||||||
.Fn randomid_new
|
.Fn randomid_new
|
||||||
returns
|
returns
|
||||||
.Dv NULL
|
.Dv NULL
|
||||||
on error and set the external variable
|
on error and sets the external variable
|
||||||
.Va errno .
|
.Va errno .
|
||||||
.\"
|
.\"
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
|
|
Loading…
Reference in New Issue