139 lines
4.2 KiB
Groff
139 lines
4.2 KiB
Groff
.\" Copyright (c) 1980, 1991, 1993
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
.\"
|
|
.\" 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 by the University of
|
|
.\" California, Berkeley and its contributors.
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
.\" may be used to endorse or promote products derived from this software
|
|
.\" without specific prior written permission.
|
|
.\"
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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.
|
|
.\"
|
|
.\" @(#)lseek.2 8.3 (Berkeley) 4/19/94
|
|
.\" %FreeBSD: src/lib/libc/sys/lseek.2,v 1.21 2004/07/02 23:52:13 ru Exp %
|
|
.\"
|
|
.\" $FreeBSD$
|
|
.Dd April 19, 1994
|
|
.Dt LSEEK 2
|
|
.Os
|
|
.Sh ̾¾Î
|
|
.Nm lseek
|
|
.Nd ÆÉ¼è¤ê / ½ñ¹þ¤ß¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤òÊѹ¹¤¹¤ë
|
|
.Sh ¥é¥¤¥Ö¥é¥ê
|
|
.Lb libc
|
|
.Sh ½ñ¼°
|
|
.In unistd.h
|
|
.Ft off_t
|
|
.Fn lseek "int fildes" "off_t offset" "int whence"
|
|
.Sh ²òÀâ
|
|
.Fn lseek
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¥Ç¥£¥ì¥¯¥Æ¥£¥Ö
|
|
.Fa whence
|
|
¤Ë½¾¤Ã¤Æ¥Õ¥¡¥¤¥ëµ½Ò»Ò
|
|
.Fa fildes
|
|
¤Î¥ª¥Õ¥»¥Ã¥È¤ò°ú¿ô
|
|
.Fa offset
|
|
¤Ë°Üư¤·¤Þ¤¹¡£
|
|
°ú¿ô
|
|
.Fa fildes
|
|
¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
|
|
.Fn lseek
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¥Õ¥¡¥¤¥ëµ½Ò»Ò
|
|
.Fa fildes
|
|
¤ËÂбþ¤¹¤ë¥Õ¥¡¥¤¥ë°ÌÃ֥ݥ¤¥ó¥¿¤ò°Üư¤·¤Þ¤¹:
|
|
.Bl -item -offset indent
|
|
.It
|
|
.Fa whence
|
|
¤¬
|
|
.Dv SEEK_SET
|
|
¤Î¾ì¹ç¡¢¥ª¥Õ¥»¥Ã¥È¤Ï
|
|
.Fa offset
|
|
¥Ð¥¤¥È¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
|
|
.It
|
|
.Fa whence
|
|
¤¬
|
|
.Dv SEEK_CUR
|
|
¤Î¾ì¹ç¡¢¥ª¥Õ¥»¥Ã¥È¤Ï¸½ºß¤Î°ÌÃÖ¤Ë
|
|
.Fa offset
|
|
¥Ð¥¤¥È¤ò²Ã»»¤·¤¿¤â¤Î¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
|
|
.It
|
|
.Fa whence
|
|
¤¬
|
|
.Dv SEEK_END
|
|
¤Î¾ì¹ç¡¢¥ª¥Õ¥»¥Ã¥È¤Ï¥Õ¥¡¥¤¥ë¤Î¥µ¥¤¥º¤Ë
|
|
.Fa offset
|
|
¥Ð¥¤¥È¤ò²Ã»»¤·¤¿¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.El
|
|
.Pp
|
|
.Fn lseek
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ë¤è¤Ã¤Æ¡¢¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤ò¥Õ¥¡¥¤¥ë¤Î´û¸¤Î¥Õ¥¡¥¤¥ë¤Î
|
|
½ª¤ê (EOF) ¤ò±Û¤¨¤ë¤È¤³¤í¤ËÀßÄê¤Ç¤¤Þ¤¹¡£
|
|
¸å¤Ë¥Ç¡¼¥¿¤¬¤³¤ÎÅÀ¤Ë½ñ¤¹þ¤Þ¤ì¤ë¤È¡¢
|
|
¤½¤ì°Ê¸å¤Î¥®¥ã¥Ã¥×Æâ¤Î¥Ç¡¼¥¿¤ËÂФ¹¤ëÆÉ¼è¤ê¤Ï
|
|
(¥Ç¡¼¥¿¤¬¼ÂºÝ¤Ë¥®¥ã¥Ã¥×Æâ¤Ë½ñ¤¹þ¤Þ¤ì¤ë¤Þ¤Ç) ¥Ç¡¼¥¿¤È¤·¤Æ 0 ¤òÊÖ¤·¤Þ¤¹¡£
|
|
.Pp
|
|
¥·¡¼¥¯¤Ç¤¤Ê¤¤¥Ç¥Ð¥¤¥¹¤â¤¢¤ê¤Þ¤¹¡£
|
|
¤½¤Î¤è¤¦¤Ê¥Ç¥Ð¥¤¥¹¤ËÂбþ¤¹¤ë¥Ý¥¤¥ó¥¿¤ÎÃͤÏ̤ÄêµÁ¤Ë¤Ê¤ê¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
½èÍý¤¬Àµ¾ï¤Ë´°Î»¤¹¤ë¤È
|
|
.Fn lseek
|
|
¤Ï¡¢¥Õ¥¡¥¤¥ë¤ÎÀèÆ¬¤«¤é¬Äꤷ¤¿·ë²Ì¤Î¥ª¥Õ¥»¥Ã¥È°ÌÃÖ¤ò¥Ð¥¤¥Èñ°Ì¤ÇÊÖ¤·¤Þ¤¹¡£
|
|
¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¤Ï -1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤Ë
|
|
.Va errno
|
|
¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£
|
|
.Sh ¥¨¥é¡¼
|
|
.Fn lseek
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¼¡¤Î¾ì¹ç¤Ë½èÍý¤ò¼ºÇÔ¤·¡¢¥Õ¥¡¥¤¥ë°ÌÃ֥ݥ¤¥ó¥¿¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó:
|
|
.Bl -tag -width Er
|
|
.It Bq Er EBADF
|
|
.Fa fildes
|
|
°ú¿ô¤¬¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
|
.It Bq Er EINVAL
|
|
.Fa whence
|
|
°ú¿ô¤¬Àµ¤·¤¤ÃͤǤϤʤ¤¤«¡¢·×»»·ë²Ì¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤¬
|
|
¥¥ã¥é¥¯¥¿·¿¤Ç¤Ï¤Ê¤¤ÆÃ¼ì¥Õ¥¡¥¤¥ë¤Ë»È¤¦Éé¤ÎÃͤȤʤê¤Þ¤·¤¿¡£
|
|
.It Bq Er EOVERFLOW
|
|
·×»»·ë²Ì¤Î¥Õ¥¡¥¤¥ë¥ª¥Õ¥»¥Ã¥È¤¬¡¢
|
|
.Fa off_t
|
|
·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤ÏÀµ¤·¤¯É½¸½¤Ç¤¤Ê¤¤ÃͤȤʤê¤Þ¤·¤¿¡£
|
|
.It Bq Er ESPIPE
|
|
.Fa fildes
|
|
°ú¿ô¤Ï¥Ñ¥¤¥×¡¢¥½¥±¥Ã¥È¡¢¤Þ¤¿¤Ï FIFO ¤ÈÂбþ¤Å¤±¤é¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.El
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr dup 2 ,
|
|
.Xr open 2
|
|
.Sh ¥Ð¥°
|
|
¤³¤Î¥É¥¥å¥á¥ó¥È¤Î
|
|
.Fa whence
|
|
¤Î»ÈÍÑË¡¤ÏÀµ¤·¤¯¤Ê¤¤±Ñ¸ì¤Ç¤¹¤¬¡¢Îò»ËŪ¤ÊÍýͳ¤Ç°Ý»ý¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Sh µ¬³Ê
|
|
.Fn lseek
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
.St -p1003.1-90
|
|
¤ËŬ¹ç¤·¤Æ¤¤¤Þ¤¹¡£
|
|
.Sh Îò»Ë
|
|
.Fn lseek
|
|
´Ø¿ô¤Ï
|
|
.At v7
|
|
¤ÇÅо줷¤Þ¤·¤¿¡£
|