Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man9 add m_copyup(9) obtained from FreeBSD (manual...



details:   https://anonhg.NetBSD.org/src/rev/4345bb6af99c
branches:  trunk
changeset: 787427:4345bb6af99c
user:      ryo <ryo%NetBSD.org@localhost>
date:      Mon Jun 17 09:58:21 2013 +0000

description:
add m_copyup(9) obtained from FreeBSD (manual only)

diffstat:

 share/man/man9/Makefile |   6 +++---
 share/man/man9/mbuf.9   |  27 +++++++++++++++++++++++++--
 2 files changed, 28 insertions(+), 5 deletions(-)

diffs (82 lines):

diff -r 886c2da9d50e -r 4345bb6af99c share/man/man9/Makefile
--- a/share/man/man9/Makefile   Mon Jun 17 05:13:07 2013 +0000
+++ b/share/man/man9/Makefile   Mon Jun 17 09:58:21 2013 +0000
@@ -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 @@
        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 \
diff -r 886c2da9d50e -r 4345bb6af99c share/man/man9/mbuf.9
--- a/share/man/man9/mbuf.9     Mon Jun 17 05:13:07 2013 +0000
+++ b/share/man/man9/mbuf.9     Mon Jun 17 09:58:21 2013 +0000
@@ -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 @@
 .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



Home | Main Index | Thread Index | Old Index