Catch up to WAIT/NOWAIT cleanup.
This commit is contained in:
parent
44956c9863
commit
2a62ffb72d
@ -154,27 +154,8 @@ will return
|
|||||||
.Dv NULL
|
.Dv NULL
|
||||||
rather than block.
|
rather than block.
|
||||||
Note that
|
Note that
|
||||||
.Dv M_WAITOK
|
|
||||||
is defined to be 0, meaning that blocking operation is the default.
|
|
||||||
Also note that
|
|
||||||
.Dv M_NOWAIT
|
.Dv M_NOWAIT
|
||||||
is required when running in an interrupt context.
|
is required when running in an interrupt context.
|
||||||
.Pp
|
|
||||||
Programmers should be careful not to confuse
|
|
||||||
.Dv M_NOWAIT ,
|
|
||||||
the
|
|
||||||
.Fn malloc
|
|
||||||
flag, with
|
|
||||||
.Dv M_DONTWAIT ,
|
|
||||||
an
|
|
||||||
.Xr mbuf 9
|
|
||||||
allocation flag, which is not a valid argument to
|
|
||||||
.Fn malloc .
|
|
||||||
.It Dv M_WAITOK
|
|
||||||
Indicates that it is Ok to wait for resources. It is unconveniently
|
|
||||||
defined as 0 so care should be taken never to compare against this value
|
|
||||||
directly or try to AND it as a flag. The default operation is to block
|
|
||||||
until the memory allocation succeeds.
|
|
||||||
.Fn malloc ,
|
.Fn malloc ,
|
||||||
.Fn realloc ,
|
.Fn realloc ,
|
||||||
and
|
and
|
||||||
|
@ -278,14 +278,14 @@ on failure.
|
|||||||
The
|
The
|
||||||
.Fa how
|
.Fa how
|
||||||
argument is to be set to
|
argument is to be set to
|
||||||
.Dv M_TRYWAIT
|
.Dv 0
|
||||||
or
|
or
|
||||||
.Dv M_DONTWAIT .
|
.Dv M_NOWAIT .
|
||||||
It specifies whether the caller is willing to block if necessary.
|
It specifies whether the caller is willing to block if necessary.
|
||||||
If
|
If
|
||||||
.Fa how
|
.Fa how
|
||||||
is set to
|
is set to
|
||||||
.Dv M_TRYWAIT ,
|
.Dv 0 ,
|
||||||
a failed allocation will result in the caller being put
|
a failed allocation will result in the caller being put
|
||||||
to sleep for a designated
|
to sleep for a designated
|
||||||
kern.ipc.mbuf_wait
|
kern.ipc.mbuf_wait
|
||||||
@ -295,14 +295,6 @@ number of ticks.
|
|||||||
A number of other mbuf-related
|
A number of other mbuf-related
|
||||||
functions and macros have the same argument because they may
|
functions and macros have the same argument because they may
|
||||||
at some point need to allocate new mbufs.
|
at some point need to allocate new mbufs.
|
||||||
.Pp
|
|
||||||
Programmers should be careful not to confuse the mbuf allocation flag
|
|
||||||
.Dv M_DONTWAIT
|
|
||||||
with the
|
|
||||||
.Xr malloc 9
|
|
||||||
allocation flag,
|
|
||||||
.Dv M_NOWAIT .
|
|
||||||
They are not the same.
|
|
||||||
.It Fn MGETHDR mbuf how type
|
.It Fn MGETHDR mbuf how type
|
||||||
Allocate an mbuf and initialize it to contain a packet header
|
Allocate an mbuf and initialize it to contain a packet header
|
||||||
and internal data.
|
and internal data.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user