summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-01-18 03:25:40 +0000
committerrwatson <rwatson@FreeBSD.org>2003-01-18 03:25:40 +0000
commit3fdcc957db60880f922ff538b2e4687af7d46509 (patch)
treef88f778ac5b82b3f5f01d6d352a372cfd8035fc9 /share
parent1f8dd35ac4ae56da5878261f226a2969c523ee58 (diff)
downloadFreeBSD-src-3fdcc957db60880f922ff538b2e4687af7d46509.zip
FreeBSD-src-3fdcc957db60880f922ff538b2e4687af7d46509.tar.gz
Caution programmers not to confuse M_DONTWAIT with M_NOWAIT. They
are not the same. Suggested by: Hiten Pandya <hiten@unixdaemons.com>
Diffstat (limited to 'share')
-rw-r--r--share/man/man9/malloc.911
-rw-r--r--share/man/man9/mbuf.98
2 files changed, 19 insertions, 0 deletions
diff --git a/share/man/man9/malloc.9 b/share/man/man9/malloc.9
index ff07220..6013897 100644
--- a/share/man/man9/malloc.9
+++ b/share/man/man9/malloc.9
@@ -159,6 +159,17 @@ is defined to be 0, meaning that blocking operation is the default.
Also note that
.Dv M_NOWAIT
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
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 6472289..b10e6ea 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -295,6 +295,14 @@ number of ticks.
A number of other mbuf-related
functions and macros have the same argument because they may
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
Allocate an mbuf and initialize it to contain a packet header
and internal data.
OpenPOWER on IntegriCloud