Module Name: src Committed By: maxv Date: Fri Apr 27 06:06:43 UTC 2018
Modified Files: src/share/man/man9: mbuf.9 Log Message: Improve the documentation of m_copypacket(), to say explicitly that a header must be present, contrary to m_copym(). While here fix a variable name (from yesterday). To generate a diff of this commit: cvs rdiff -u -r1.59 -r1.60 src/share/man/man9/mbuf.9 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man9/mbuf.9 diff -u src/share/man/man9/mbuf.9:1.59 src/share/man/man9/mbuf.9:1.60 --- src/share/man/man9/mbuf.9:1.59 Thu Apr 26 08:13:30 2018 +++ src/share/man/man9/mbuf.9 Fri Apr 27 06:06:43 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: mbuf.9,v 1.59 2018/04/26 08:13:30 maxv Exp $ +.\" $NetBSD: mbuf.9,v 1.60 2018/04/27 06:06:43 maxv Exp $ .\" .\" Copyright (c) 1997 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 26, 2018 +.Dd April 27, 2018 .Dt MBUF 9 .Os .Sh NAME @@ -284,9 +284,14 @@ parameter is a choice of .Dv M_WAIT / M_DONTWAIT from caller. .It Fn m_copypacket "struct mbuf *m" "int how" -Copies an entire packet, including header (which must be present). +Copies an entire packet, including header. This function is an optimization of the common case .Li m_copym ( m , 0 , Dv M_COPYALL , Fa how ) . +However, contrary to +.Fn m_copym , +a header must be present. It is incorrect to use +.Fn m_copypacket +with an mbuf that does not have a header. .It Fn m_copydata "struct mbuf *m" "int off" "int len" "void *cp" Copies .Fa len @@ -478,7 +483,7 @@ must be less than .It Fn m_split "struct mbuf *m0" "int len" "int wait" Partitions an mbuf chain in two pieces, returning the tail, which is all but the first -.Fa len0 +.Fa len bytes. In case of failure, it returns .Dv NULL