Mon Jun 17 09:58:22 2013 UTC ()
add m_copyup(9) obtained from FreeBSD (manual only)


(ryo)
diff -r1.371 -r1.372 src/share/man/man9/Makefile
diff -r1.50 -r1.51 src/share/man/man9/mbuf.9

cvs diff -r1.371 -r1.372 src/share/man/man9/Makefile (expand / switch to unified diff)

--- src/share/man/man9/Makefile 2013/05/22 16:01:44 1.371
+++ src/share/man/man9/Makefile 2013/06/17 09:58:21 1.372
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: Makefile,v 1.371 2013/05/22 16:01:44 christos Exp $ 1# $NetBSD: Makefile,v 1.372 2013/06/17 09:58:21 ryo Exp $
2 2
3# Makefile for section 9 (kernel function and variable) manual pages. 3# Makefile for section 9 (kernel function and variable) manual pages.
4 4
5MAN= accept_filter.9 accf_data.9 accf_http.9 \ 5MAN= accept_filter.9 accf_data.9 accf_http.9 \
6 altq.9 arp.9 audio.9 autoconf.9 \ 6 altq.9 arp.9 audio.9 autoconf.9 \
7 bcdtobin.9 bcmp.9 bcopy.9 bintime_add.9 bluetooth.9 boothowto.9 bpf.9 \ 7 bcdtobin.9 bcmp.9 bcopy.9 bintime_add.9 bluetooth.9 boothowto.9 bpf.9 \
8 buffercache.9 bufq.9 bus_dma.9 bus_space.9 byteorder.9 bzero.9 \ 8 buffercache.9 bufq.9 bus_dma.9 bus_space.9 byteorder.9 bzero.9 \
9 callback.9 callout.9 cardbus.9 cnmagic.9 condvar.9 config.9 \ 9 callback.9 callout.9 cardbus.9 cnmagic.9 condvar.9 config.9 \
10 cons.9 copy.9 coredump_write.9 \ 10 cons.9 copy.9 coredump_write.9 \
11 cpu_configure.9 cpu_coredump.9 cpu_dumpconf.9 \ 11 cpu_configure.9 cpu_coredump.9 cpu_dumpconf.9 \
12 cpu_lwp_fork.9 \ 12 cpu_lwp_fork.9 \
13 cpu_idle.9 cpu_initclocks.9 cpu_need_resched.9 \ 13 cpu_idle.9 cpu_initclocks.9 cpu_need_resched.9 \
14 cpu_number.9 cpu_reboot.9 cpu_rootconf.9 \ 14 cpu_number.9 cpu_reboot.9 cpu_rootconf.9 \
@@ -452,28 +452,28 @@ MLINKS+=lock.9 simple_lock_init.9 lock.9 @@ -452,28 +452,28 @@ MLINKS+=lock.9 simple_lock_init.9 lock.9
452 lock.9 spinlockinit.9 lock.9 spinlockmgr.9 452 lock.9 spinlockinit.9 lock.9 spinlockmgr.9
453MLINKS+=ltsleep.9 wakeup.9 ltsleep.9 tsleep.9 453MLINKS+=ltsleep.9 wakeup.9 ltsleep.9 tsleep.9
454MLINKS+=malloc.9 MALLOC.9 malloc.9 realloc.9 malloc.9 free.9 malloc.9 FREE.9 454MLINKS+=malloc.9 MALLOC.9 malloc.9 realloc.9 malloc.9 free.9 malloc.9 FREE.9
455MLINKS+=malloc.9 malloc_roundup.9 malloc.9 malloc_type_attach.9 455MLINKS+=malloc.9 malloc_roundup.9 malloc.9 malloc_type_attach.9
456MLINKS+=malloc.9 malloc_type_detach.9 malloc.9 malloc_type_setlimit.9 456MLINKS+=malloc.9 malloc_type_detach.9 malloc.9 malloc_type_setlimit.9
457MLINKS+=malloc.9 MALLOC_DEFINE_LIMIT.9 malloc.9 MALLOC_DEFINE.9 457MLINKS+=malloc.9 MALLOC_DEFINE_LIMIT.9 malloc.9 MALLOC_DEFINE.9
458MLINKS+=malloc.9 MALLOC_DECLARE.9 458MLINKS+=malloc.9 MALLOC_DECLARE.9
459MLINKS+=mb.9 mb_memory.9 mb.9 mb_read.9 mb.9 mb_write.9 459MLINKS+=mb.9 mb_memory.9 mb.9 mb_read.9 mb.9 mb_write.9
460MLINKS+=mbuf.9 m_get.9 mbuf.9 m_getclr.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \ 460MLINKS+=mbuf.9 m_get.9 mbuf.9 m_getclr.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
461 mbuf.9 m_copym.9 mbuf.9 m_copypacket.9 mbuf.9 m_copydata.9 \ 461 mbuf.9 m_copym.9 mbuf.9 m_copypacket.9 mbuf.9 m_copydata.9 \
462 mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \ 462 mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \
463 mbuf.9 m_copyback_cow.9 \ 463 mbuf.9 m_copyback_cow.9 \
464 mbuf.9 m_makewritable.9 \ 464 mbuf.9 m_makewritable.9 \
465 mbuf.9 m_pulldown.9 \ 465 mbuf.9 m_pulldown.9 mbuf.9 m_pullup.9 mbuf.9 m_copyup.9 \
466 mbuf.9 m_pullup.9 mbuf.9 m_split.9 mbuf.9 m_adj.9 mbuf.9 m_free.9 \ 466 mbuf.9 m_split.9 mbuf.9 m_adj.9 mbuf.9 m_free.9 \
467 mbuf.9 m_freem.9 mbuf.9 mtod.9 mbuf.9 mtocl.9 mbuf.9 cltom.9 \ 467 mbuf.9 m_freem.9 mbuf.9 mtod.9 mbuf.9 mtocl.9 mbuf.9 cltom.9 \
468 mbuf.9 MGET.9 mbuf.9 MGETHDR.9 mbuf.9 MEXTMALLOC.9 \ 468 mbuf.9 MGET.9 mbuf.9 MGETHDR.9 mbuf.9 MEXTMALLOC.9 \
469 mbuf.9 MEXTADD.9 mbuf.9 MCLGET.9 mbuf.9 M_COPY_PKTHDR.9 \ 469 mbuf.9 MEXTADD.9 mbuf.9 MCLGET.9 mbuf.9 M_COPY_PKTHDR.9 \
470 mbuf.9 M_MOVE_PKTHDR.9 \ 470 mbuf.9 M_MOVE_PKTHDR.9 \
471 mbuf.9 M_ALIGN.9 mbuf.9 MH_ALIGN.9 mbuf.9 M_LEADINGSPACE.9 \ 471 mbuf.9 M_ALIGN.9 mbuf.9 MH_ALIGN.9 mbuf.9 M_LEADINGSPACE.9 \
472 mbuf.9 M_TRAILINGSPACE.9 mbuf.9 M_PREPEND.9 mbuf.9 MCHTYPE.9 \ 472 mbuf.9 M_TRAILINGSPACE.9 mbuf.9 M_PREPEND.9 mbuf.9 MCHTYPE.9 \
473 mbuf.9 MFREE.9 473 mbuf.9 MFREE.9
474MLINKS+=mca.9 mca_intr_establish.9 \ 474MLINKS+=mca.9 mca_intr_establish.9 \
475 mca.9 mca_intr_disestablish.9 \ 475 mca.9 mca_intr_disestablish.9 \
476 mca.9 mca_intr_evcnt.9 \ 476 mca.9 mca_intr_evcnt.9 \
477 mca.9 mca_conf_read.9 \ 477 mca.9 mca_conf_read.9 \
478 mca.9 mca_conf_write.9 478 mca.9 mca_conf_write.9
479MLINKS+=microtime.9 bintime.9 \ 479MLINKS+=microtime.9 bintime.9 \

cvs diff -r1.50 -r1.51 src/share/man/man9/mbuf.9 (expand / switch to unified diff)

--- src/share/man/man9/mbuf.9 2010/12/02 12:54:13 1.50
+++ src/share/man/man9/mbuf.9 2013/06/17 09:58:21 1.51
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: mbuf.9,v 1.50 2010/12/02 12:54:13 wiz Exp $ 1.\" $NetBSD: mbuf.9,v 1.51 2013/06/17 09:58:21 ryo Exp $
2.\" 2.\"
3.\" Copyright (c) 1997 The NetBSD Foundation, Inc. 3.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
4.\" All rights reserved. 4.\" All rights reserved.
5.\" 5.\"
6.\" This documentation is derived from text contributed to The NetBSD Foundation 6.\" This documentation is derived from text contributed to The NetBSD Foundation
7.\" by S.P.Zeidler (aka stargazer). 7.\" by S.P.Zeidler (aka stargazer).
8.\" 8.\"
9.\" Redistribution and use in source and binary forms, with or without 9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions 10.\" modification, are permitted provided that the following conditions
11.\" are met: 11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright 12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer. 13.\" notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright 14.\" 2. Redistributions in binary form must reproduce the above copyright
@@ -17,46 +17,47 @@ @@ -17,46 +17,47 @@
17.\" 17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE. 28.\" POSSIBILITY OF SUCH DAMAGE.
29.\" 29.\"
30.Dd March 24, 2008 30.Dd June 17, 2013
31.Dt MBUF 9 31.Dt MBUF 9
32.Os 32.Os
33.Sh NAME 33.Sh NAME
34.Nm mbuf , 34.Nm mbuf ,
35.Nm m_get , 35.Nm m_get ,
36.Nm m_getclr , 36.Nm m_getclr ,
37.Nm m_gethdr , 37.Nm m_gethdr ,
38.Nm m_devget , 38.Nm m_devget ,
39.Nm m_copym , 39.Nm m_copym ,
40.Nm m_copypacket , 40.Nm m_copypacket ,
41.Nm m_copydata , 41.Nm m_copydata ,
42.Nm m_copyback , 42.Nm m_copyback ,
43.Nm m_copyback_cow , 43.Nm m_copyback_cow ,
44.Nm m_cat , 44.Nm m_cat ,
45.Nm m_dup , 45.Nm m_dup ,
46.Nm m_makewritable , 46.Nm m_makewritable ,
47.Nm m_prepend , 47.Nm m_prepend ,
48.Nm m_pulldown , 48.Nm m_pulldown ,
49.Nm m_pullup , 49.Nm m_pullup ,
 50.Nm m_copyup ,
50.Nm m_split , 51.Nm m_split ,
51.Nm m_adj , 52.Nm m_adj ,
52.Nm m_apply , 53.Nm m_apply ,
53.Nm m_free , 54.Nm m_free ,
54.Nm m_freem , 55.Nm m_freem ,
55.Nm mtod , 56.Nm mtod ,
56.Nm MGET , 57.Nm MGET ,
57.Nm MGETHDR , 58.Nm MGETHDR ,
58.Nm MEXTMALLOC , 59.Nm MEXTMALLOC ,
59.Nm MEXTADD , 60.Nm MEXTADD ,
60.Nm MCLGET , 61.Nm MCLGET ,
61.Nm M_COPY_PKTHDR , 62.Nm M_COPY_PKTHDR ,
62.Nm M_MOVE_PKTHDR , 63.Nm M_MOVE_PKTHDR ,
@@ -91,26 +92,28 @@ @@ -91,26 +92,28 @@
91.Ft int 92.Ft int
92.Fn m_makewritable "struct mbuf **mp" "int off" "int len" "int how" 93.Fn m_makewritable "struct mbuf **mp" "int off" "int len" "int how"
93.Ft void 94.Ft void
94.Fn m_cat "struct mbuf *m" "struct mbuf *n" 95.Fn m_cat "struct mbuf *m" "struct mbuf *n"
95.Ft struct mbuf * 96.Ft struct mbuf *
96.Fn m_dup "struct mbuf *m" "int off0" "int len" "int wait" 97.Fn m_dup "struct mbuf *m" "int off0" "int len" "int wait"
97.Ft struct mbuf * 98.Ft struct mbuf *
98.Fn m_prepend "struct mbuf *m" "int len" "int how" 99.Fn m_prepend "struct mbuf *m" "int len" "int how"
99.Ft struct mbuf * 100.Ft struct mbuf *
100.Fn m_pulldown "struct mbuf *m" "int off" "int len" "int *offp" 101.Fn m_pulldown "struct mbuf *m" "int off" "int len" "int *offp"
101.Ft struct mbuf * 102.Ft struct mbuf *
102.Fn m_pullup "struct mbuf *n" "int len" 103.Fn m_pullup "struct mbuf *n" "int len"
103.Ft struct mbuf * 104.Ft struct mbuf *
 105.Fn m_copyup "struct mbuf *m" "int len" "int dstoff"
 106.Ft struct mbuf *
104.Fn m_split "struct mbuf *m0" "int len0" "int wait" 107.Fn m_split "struct mbuf *m0" "int len0" "int wait"
105.Ft void 108.Ft void
106.Fn m_adj "struct mbuf *mp" "int req_len" 109.Fn m_adj "struct mbuf *mp" "int req_len"
107.Ft int 110.Ft int
108.Fn m_apply "struct mbuf *m" "int off" "int len" "int *f(void *, void *, unsigned int)" "void *arg" 111.Fn m_apply "struct mbuf *m" "int off" "int len" "int *f(void *, void *, unsigned int)" "void *arg"
109.Ft struct mbuf * 112.Ft struct mbuf *
110.Fn m_free "struct mbuf *m" 113.Fn m_free "struct mbuf *m"
111.Ft void 114.Ft void
112.Fn m_freem "struct mbuf *m" 115.Fn m_freem "struct mbuf *m"
113.Ft datatype 116.Ft datatype
114.Fn mtod "struct mbuf *m" "datatype" 117.Fn mtod "struct mbuf *m" "datatype"
115.Ft void 118.Ft void
116.Fn MGET "struct mbuf *m" "int how" "int type" 119.Fn MGET "struct mbuf *m" "int how" "int type"
@@ -475,26 +478,46 @@ will work for a structure of size @@ -475,26 +478,46 @@ will work for a structure of size
475Returns the resulting 478Returns the resulting
476mbuf chain on success, frees it and returns 479mbuf chain on success, frees it and returns
477.Dv NULL 480.Dv NULL
478on failure. 481on failure.
479If there is room, it will add up to 482If there is room, it will add up to
480.Dv max_protohdr 483.Dv max_protohdr
481- 484-
482.Fa len 485.Fa len
483extra bytes to the 486extra bytes to the
484contiguous region to possibly avoid being called again. 487contiguous region to possibly avoid being called again.
485.Fa len 488.Fa len
486must be smaller or equal than 489must be smaller or equal than
487.Dv MHLEN . 490.Dv MHLEN .
 491.It Fn m_copyup "struct mbuf *m" "int len" "int dstoff"
 492Similar to
 493.Fn m_pullup
 494but copies
 495.Fa len
 496bytes of data into a new mbuf at
 497.Fa dstoff
 498bytes into the mbuf.
 499The
 500.Fa dstoff
 501argument aligns the data and leaves room for a link layer header.
 502Returns the new
 503mbuf chain on success, and frees the mbuf chain and returns
 504.Dv NULL
 505on failure.
 506Note that
 507the function does not allocate mbuf clusters, so
 508.Fa len + dstoff
 509must be less than
 510.Dv MHLEN .
488.It Fn m_split "struct mbuf *m0" "int len0" "int wait" 511.It Fn m_split "struct mbuf *m0" "int len0" "int wait"
489Partitions an mbuf chain in two pieces, returning the tail, 512Partitions an mbuf chain in two pieces, returning the tail,
490which is all but the first 513which is all but the first
491.Fa len0 514.Fa len0
492bytes. 515bytes.
493In case of failure, it returns 516In case of failure, it returns
494.Dv NULL 517.Dv NULL
495and attempts to 518and attempts to
496restore the chain to its original state. 519restore the chain to its original state.
497.It Fn m_adj "struct mbuf *mp" "int req_len" 520.It Fn m_adj "struct mbuf *mp" "int req_len"
498Shaves off 521Shaves off
499.Fa req_len 522.Fa req_len
500bytes from head or tail of the (valid) data area. 523bytes from head or tail of the (valid) data area.