140 lines
3.7 KiB
Groff
140 lines
3.7 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.
|
|
.\"
|
|
.\" @(#)ioctl.2 8.2 (Berkeley) 12/11/93
|
|
.\"
|
|
.\" %FreeBSD: src/lib/libc/sys/ioctl.2,v 1.6.2.1 1999/08/29 14:49:05 peter Exp %
|
|
.\"
|
|
.Dd December 11, 1993
|
|
.Dt IOCTL 2
|
|
.Os BSD 4
|
|
.Sh ̾¾Î
|
|
.Nm ioctl
|
|
.Nd ¥Ç¥Ð¥¤¥¹¤òÀ©¸æ¤¹¤ë
|
|
.Sh ½ñ¼°
|
|
.Fd #include <sys/ioctl.h>
|
|
.Ft int
|
|
.Fn ioctl "int d" "unsigned long request" ...
|
|
.Sh ²òÀâ
|
|
.Fn ioctl
|
|
´Ø¿ô¤ÏÆÃ¼ì¥Õ¥¡¥¤¥ë¤Î²¼ÁؤȤʤäƤ¤¤ë¥Ç¥Ð¥¤¥¹¤Î¥Ñ¥é¥á¡¼¥¿¤òÁàºî¤·¤Þ¤¹¡£
|
|
ÆÃ¤Ë¡¢¥¥ã¥é¥¯¥¿·¿ÆÃ¼ì¥Õ¥¡¥¤¥ë (¤¿¤È¤¨¤Ð¡¢Ã¼Ëö) ¤Î¿¿ô¤ÎÁàºî°À¤Ï
|
|
.Fn ioctl
|
|
¤ÇÀ©¸æ¤Ç¤¤Þ¤¹¡£°ú¿ô
|
|
.Fa d
|
|
¤Ï¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ëµ½Ò»Ò¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
.Nm
|
|
¤Ø¤Î 3 ÈÖ¤á¤Î°ú¿ô¤Ï½¾Í褫¤é
|
|
.Ar "char *argp"
|
|
¤È̾Á°ÉÕ¤±¤é¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Fx 3.0
|
|
¤Ç¤Î
|
|
.Nm
|
|
¤Î¤Û¤È¤ó¤É¤Î»ÈÍÑË¡¤Ç¤Ï¡¢3 ÈÖ¤á¤Î°ú¿ô¤¬
|
|
.Ar caddr_t
|
|
¤Þ¤¿¤Ï
|
|
.Ar int
|
|
¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
|
|
.Pp
|
|
ioctl ¤Î
|
|
.Fa request
|
|
¤Ï¡¢°ú¿ô¤¬
|
|
.Dq in
|
|
¥Ñ¥é¥á¡¼¥¿¤Þ¤¿¤Ï
|
|
.Dq out
|
|
¥Ñ¥é¥á¡¼¥¿¤Ç¤¢¤ë¤«¤É¤¦¤«¤È¡¢°ú¿ô
|
|
.Fa argp
|
|
¤Î¥µ¥¤¥º (¥Ð¥¤¥Èñ°Ì) ¤Ç¥¨¥ó¥³¡¼¥É¤µ¤ì¤Þ¤¹¡£
|
|
ioctl ¤Î
|
|
.Fa request
|
|
¤ò»ØÄꤹ¤ë¤Î¤Ë»ÈÍѤµ¤ì¤ë¥Þ¥¯¥í¤ÈÄêµÁ
|
|
¤Ï¥Õ¥¡¥¤¥ë
|
|
.Ao Pa sys/ioctl.h Ac
|
|
¤ÎÃæ¤Ë¤¢¤ê¤Þ¤¹¡£
|
|
.Sh ¥·¥¹¥Æ¥à¤ÎÃí°Õ»ö¹à
|
|
.Pp
|
|
Èó¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê
|
|
.Fn ioctl
|
|
¤Ï¡¢
|
|
.Va ioctl
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
|
|
.Pp
|
|
¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Î¾ì¹ç¡¢
|
|
.Va ioctl
|
|
¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï
|
|
.Fn _thread_sys_ioctl
|
|
¤Ë¥¢¥»¥ó¥Ö¥ë¤µ¤ì¡¢
|
|
.Fn ioctl
|
|
¤Ï¡¢ÆÉ¤ß½ñ¤¤Ë¤Ä¤¤¤Æ
|
|
.Va d
|
|
¤ò¥í¥Ã¥¯¤·¤Æ¤«¤é
|
|
.Fn _thread_sys_ioctl
|
|
¸Æ¤Ó½Ð¤¹´Ø¿ô¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Ìá¤ëÁ°¤Ë
|
|
.Fn ioctl
|
|
¤Ï
|
|
.Va d
|
|
¤ò¥¢¥ó¥í¥Ã¥¯¤·¤Þ¤¹¡£
|
|
.Sh Ìá¤êÃÍ
|
|
¥¨¥é¡¼¤¬µ¯¤¤¿¾ì¹ç¤Ï -1 ¤¬ÊÖ¤µ¤ì¡¢¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤Ë
|
|
.Va errno
|
|
¤¬ÀßÄꤵ¤ì¤Þ¤¹¡£
|
|
.Sh ¥¨¥é¡¼
|
|
.Fn Ioctl
|
|
¤Ï¼¡¤Î¾ì¹ç¤Ë¼ºÇÔ¤·¤Þ¤¹¡£
|
|
.Bl -tag -width [ENOTTY]
|
|
.It Bq Er EBADF
|
|
.Fa d
|
|
¤¬Í¸ú¤Êµ½Ò»Ò¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
|
.It Bq Er ENOTTY
|
|
.Fa d
|
|
¤¬¥¥ã¥é¥¯¥¿·¿ÆÃ¼ì¥Ç¥Ð¥¤¥¹¤ËÂбþ¤·¤Æ¤¤¤Þ¤»¤ó¡£
|
|
.It Bq Er ENOTTY
|
|
»ØÄꤵ¤ì¤¿Í×µá¤Ïµ½Ò»Ò
|
|
.Fa d
|
|
¤¬»²¾È¤¹¤ë¼ïÎà¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤ÏŬÍѤµ¤ì¤Þ¤»¤ó¡£
|
|
.It Bq Er EINVAL
|
|
.Fa request
|
|
¤Þ¤¿¤Ï
|
|
.Fa argp
|
|
¤¬Í¸ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
|
|
.El
|
|
.Sh ´ØÏ¢¹àÌÜ
|
|
.Xr mt 1 ,
|
|
.Xr execve 2 ,
|
|
.Xr fcntl 2 ,
|
|
.Xr intro 4 ,
|
|
.Xr tty 4
|
|
.Sh Îò»Ë
|
|
.Fn ioctl
|
|
´Ø¿ô¤Ï
|
|
.At v7
|
|
¤ÇÅо줷¤Þ¤·¤¿¡£
|