Module Name: src
Committed By: ryo
Date: Mon Jun 17 09:58:22 UTC 2013
Modified Files:
src/share/man/man9: Makefile mbuf.9
Log Message:
add m_copyup(9) obtained from FreeBSD (manual only)
To generate a diff of this commit:
cvs rdiff -u -r1.371 -r1.372 src/share/man/man9/Makefile
cvs rdiff -u -r1.50 -r1.51 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/Makefile
diff -u src/share/man/man9/Makefile:1.371 src/share/man/man9/Makefile:1.372
--- src/share/man/man9/Makefile:1.371 Wed May 22 16:01:44 2013
+++ src/share/man/man9/Makefile Mon Jun 17 09:58:21 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.371 2013/05/22 16:01:44 christos Exp $
+# $NetBSD: Makefile,v 1.372 2013/06/17 09:58:21 ryo Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -462,8 +462,8 @@ MLINKS+=mbuf.9 m_get.9 mbuf.9 m_getclr.9
mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \
mbuf.9 m_copyback_cow.9 \
mbuf.9 m_makewritable.9 \
- mbuf.9 m_pulldown.9 \
- mbuf.9 m_pullup.9 mbuf.9 m_split.9 mbuf.9 m_adj.9 mbuf.9 m_free.9 \
+ mbuf.9 m_pulldown.9 mbuf.9 m_pullup.9 mbuf.9 m_copyup.9 \
+ mbuf.9 m_split.9 mbuf.9 m_adj.9 mbuf.9 m_free.9 \
mbuf.9 m_freem.9 mbuf.9 mtod.9 mbuf.9 mtocl.9 mbuf.9 cltom.9 \
mbuf.9 MGET.9 mbuf.9 MGETHDR.9 mbuf.9 MEXTMALLOC.9 \
mbuf.9 MEXTADD.9 mbuf.9 MCLGET.9 mbuf.9 M_COPY_PKTHDR.9 \
Index: src/share/man/man9/mbuf.9
diff -u src/share/man/man9/mbuf.9:1.50 src/share/man/man9/mbuf.9:1.51
--- src/share/man/man9/mbuf.9:1.50 Thu Dec 2 12:54:13 2010
+++ src/share/man/man9/mbuf.9 Mon Jun 17 09:58:21 2013
@@ -1,4 +1,4 @@
-.\" $NetBSD: mbuf.9,v 1.50 2010/12/02 12:54:13 wiz Exp $
+.\" $NetBSD: mbuf.9,v 1.51 2013/06/17 09:58:21 ryo 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 March 24, 2008
+.Dd June 17, 2013
.Dt MBUF 9
.Os
.Sh NAME
@@ -47,6 +47,7 @@
.Nm m_prepend ,
.Nm m_pulldown ,
.Nm m_pullup ,
+.Nm m_copyup ,
.Nm m_split ,
.Nm m_adj ,
.Nm m_apply ,
@@ -101,6 +102,8 @@
.Ft struct mbuf *
.Fn m_pullup "struct mbuf *n" "int len"
.Ft struct mbuf *
+.Fn m_copyup "struct mbuf *m" "int len" "int dstoff"
+.Ft struct mbuf *
.Fn m_split "struct mbuf *m0" "int len0" "int wait"
.Ft void
.Fn m_adj "struct mbuf *mp" "int req_len"
@@ -485,6 +488,26 @@ contiguous region to possibly avoid bein
.Fa len
must be smaller or equal than
.Dv MHLEN .
+.It Fn m_copyup "struct mbuf *m" "int len" "int dstoff"
+Similar to
+.Fn m_pullup
+but copies
+.Fa len
+bytes of data into a new mbuf at
+.Fa dstoff
+bytes into the mbuf.
+The
+.Fa dstoff
+argument aligns the data and leaves room for a link layer header.
+Returns the new
+mbuf chain on success, and frees the mbuf chain and returns
+.Dv NULL
+on failure.
+Note that
+the function does not allocate mbuf clusters, so
+.Fa len + dstoff
+must be less than
+.Dv MHLEN .
.It Fn m_split "struct mbuf *m0" "int len0" "int wait"
Partitions an mbuf chain in two pieces, returning the tail,
which is all but the first