d100276457
Submitted by: Akira Ikeuchi <a_ikeuchi@mic.mitsumi.co.jp> Reviewed by: Watanabe Kazuhiro <CQG00620@nifty.ne.jp>
151 lines
4.1 KiB
Groff
151 lines
4.1 KiB
Groff
.\" %NetBSD: copy.9,v 1.2 1996/01/09 03:23:04 thorpej Exp %
|
|
.\"
|
|
.\" Copyright (c) 1996 Jason R. Thorpe.
|
|
.\" All rights reserved.
|
|
.\"
|
|
.\" This code is derived from software contributed by Kenneth Stailey.
|
|
.\"
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
.\" modification, are permitted provided that the following conditions
|
|
.\" are met:
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
.\" must display the following acknowledgement:
|
|
.\" This product includes software developed for the NetBSD Project
|
|
.\" by Jason R. Thorpe.
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
.\" derived from this software without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
.\" SUCH DAMAGE.
|
|
.\"
|
|
.\" %FreeBSD: src/share/man/man9/copy.9,v 1.15 2004/06/16 08:33:57 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd January 7, 1996
|
|
.Dt COPY 9
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm copy ,
|
|
.Nm copyin ,
|
|
.Nm copyout ,
|
|
.Nm copystr ,
|
|
.Nm copyinstr
|
|
.\" .Nm copyinstr ,
|
|
.\" .Nm copyoutstr
|
|
.Nd ¥«¡¼¥Í¥ë¥³¥Ô¡¼´Ø¿ô
|
|
.Sh ½ñ¼°
|
|
.In sys/types.h
|
|
.In sys/systm.h
|
|
.Ft int
|
|
.Fn copyin "const void *uaddr" "void *kaddr" "size_t len"
|
|
.Ft int
|
|
.Fn copyout "const void *kaddr" "void *uaddr" "size_t len"
|
|
.Ft int
|
|
.Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done"
|
|
.Ft int
|
|
.Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done"
|
|
.\" .Ft int
|
|
.\" .Fn copyoutstr "const void *kaddr" "void *uaddr" "size_t len" "size_t *done"
|
|
.Sh ²òÀâ
|
|
.Nm
|
|
´Ø¿ô·²¤ÏϢ³¤·¤¿¥Ç¡¼¥¿¤ò¤¢¤ë¥¢¥É¥ì¥¹¤«¤é
|
|
Ê̤Υ¢¥É¥ì¥¹¤Ø¥³¥Ô¡¼¤¹¤ë¤è¤¦¥Ç¥¶¥¤¥ó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Fn copystr
|
|
°Ê³°¤Î´Ø¿ô¤Ï¡¢¥æ¡¼¥¶¶õ´Ö¤«¤é¥«¡¼¥Í¥ë¶õ´Ö¤Ø¡¢
|
|
¤¢¤ë¤¤¤ÏÈ¿Âиþ¤¤Ë¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
.Pp
|
|
.Nm
|
|
´Ø¿ô·²¤Ï°Ê²¼¤Îµ¡Ç½¤òÄ󶡤·¤Þ¤¹¡£
|
|
.Bl -tag -width "copyoutstr()"
|
|
.It Fn copyin
|
|
¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa uaddr
|
|
¤«¤é¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa kaddr
|
|
¤Ø
|
|
.Fa len
|
|
¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
.It Fn copyout
|
|
¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa kaddr
|
|
¤«¤é¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa uaddr
|
|
¤Ø
|
|
.Fa len
|
|
¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
.It Fn copystr
|
|
¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa kfaddr
|
|
¤«¤é¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa kdaddr
|
|
¤Ø¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿ºÇÂç
|
|
.Fa len
|
|
ʸ»ú¤Îʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
ËöÈø¤Î¥Ì¥ëʸ»ú¤ò´Þ¤à¼ÂºÝ¤Ë¥³¥Ô¡¼¤µ¤ì¤¿Ê¸»ú¿ô¤¬
|
|
.Fa *done
|
|
¤ËÊÖ¤µ¤ì¤Þ¤¹
|
|
.Fa ( done
|
|
¤¬
|
|
.Dv NULL
|
|
¤Ç¤Ï¤Ê¤¤¾ì¹ç)¡£
|
|
.It Fn copyinstr
|
|
¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa uaddr
|
|
¤«¤é¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.Fa kaddr
|
|
¤Ø¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿ºÇÂç
|
|
.Fa len
|
|
ʸ»ú¤Îʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
ËöÈø¤Î¥Ì¥ëʸ»ú¤ò´Þ¤à¼ÂºÝ¤Ë¥³¥Ô¡¼¤µ¤ì¤¿Ê¸»ú¿ô¤¬
|
|
.Fa *done
|
|
¤ËÊÖ¤µ¤ì¤Þ¤¹
|
|
.Fa ( done
|
|
¤¬
|
|
.Dv NULL
|
|
¤Ç¤Ï¤Ê¤¤¾ì¹ç)¡£
|
|
.\" .It Fn copyoutstr
|
|
.\" ¥«¡¼¥Í¥ë¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.\" .Fa kaddr
|
|
.\" ¤«¤é¥æ¡¼¥¶¶õ´Ö¤Î¥¢¥É¥ì¥¹
|
|
.\" .Fa uaddr
|
|
.\" ¤Ø¥Ì¥ëʸ»ú¤Ç½ªÃ¼¤µ¤ì¤¿ºÇÂç
|
|
.\" .Fa len
|
|
.\" ʸ»ú¤Îʸ»úÎó¤ò¥³¥Ô¡¼¤·¤Þ¤¹¡£
|
|
.\" ËöÈø¤Î¥Ì¥ëʸ»ú¤ò´Þ¤à¼ÂºÝ¤Ë¥³¥Ô¡¼¤µ¤ì¤¿Ê¸»ú¿ô¤¬
|
|
.\" .Fa *done
|
|
.\" ¤ËÊÖ¤µ¤ì¤Þ¤¹¡£
|
|
.El
|
|
.Sh Ìá¤êÃÍ
|
|
¤½¤ì¤¾¤ì¤Î
|
|
.Nm
|
|
´Ø¿ô¤ÏÀ®¸ù¤·¤¿»þ¤Ë 0 ¤ò¡¢ÉÔÀµ¤Ê¥¢¥É¥ì¥¹¤ËÁø¶ø¤·¤¿»þ¤Ë
|
|
.Er EFAULT
|
|
¤òÊÖ¤·¤Þ¤¹¡£
|
|
¤µ¤é¤Ë¡¢
|
|
.Fn copystr
|
|
¤ª¤è¤Ó
|
|
.Fn copyinstr
|
|
.\"¡¢
|
|
.\" .Fn copyoutstr
|
|
´Ø¿ô¤Ïʸ»úÎó¤¬
|
|
.Fa len
|
|
¥Ð¥¤¥È¤è¤ê¤âŤ¤»þ¤Ë
|
|
.Er ENAMETOOLONG
|
|
¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr fetch 9 ,
|
|
.Xr store 9
|