ioctl.2 (108040) | ioctl.2 (108087) |
---|---|
1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)ioctl.2 8.2 (Berkeley) 12/11/93 33.\" | 1.\" Copyright (c) 1980, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)ioctl.2 8.2 (Berkeley) 12/11/93 33.\" |
34.\" $FreeBSD: head/lib/libc/sys/ioctl.2 108040 2002-12-18 13:33:04Z ru $ | 34.\" $FreeBSD: head/lib/libc/sys/ioctl.2 108087 2002-12-19 09:40:28Z ru $ |
35.\" 36.Dd December 11, 1993 37.Dt IOCTL 2 38.Os 39.Sh NAME 40.Nm ioctl 41.Nd control device 42.Sh LIBRARY --- 28 unchanged lines hidden (view full) --- 71or an 72.Vt int . 73.Pp 74An 75.Fn ioctl 76.Fa request 77has encoded in it whether the argument is an 78.Dq in | 35.\" 36.Dd December 11, 1993 37.Dt IOCTL 2 38.Os 39.Sh NAME 40.Nm ioctl 41.Nd control device 42.Sh LIBRARY --- 28 unchanged lines hidden (view full) --- 71or an 72.Vt int . 73.Pp 74An 75.Fn ioctl 76.Fa request 77has encoded in it whether the argument is an 78.Dq in |
79parameter | 79argument |
80or 81.Dq out | 80or 81.Dq out |
82parameter, and the size of the argument | 82argument, and the size of the argument |
83.Fa argp 84in bytes. 85Macros and defines used in specifying an ioctl 86.Fa request 87are located in the file 88.Ao Pa sys/ioctl.h Ac . 89.Sh RETURN VALUES 90If an error has occurred, a value of -1 is returned and 91.Va errno 92is set to indicate the error. 93.Sh ERRORS 94The 95.Fn ioctl 96system call 97will fail if: 98.Bl -tag -width Er 99.It Bq Er EBADF | 83.Fa argp 84in bytes. 85Macros and defines used in specifying an ioctl 86.Fa request 87are located in the file 88.Ao Pa sys/ioctl.h Ac . 89.Sh RETURN VALUES 90If an error has occurred, a value of -1 is returned and 91.Va errno 92is set to indicate the error. 93.Sh ERRORS 94The 95.Fn ioctl 96system call 97will fail if: 98.Bl -tag -width Er 99.It Bq Er EBADF |
100The |
|
100.Fa d | 101.Fa d |
102argument |
|
101is not a valid descriptor. 102.It Bq Er ENOTTY | 103is not a valid descriptor. 104.It Bq Er ENOTTY |
105The |
|
103.Fa d | 106.Fa d |
107argument |
|
104is not associated with a character 105special device. 106.It Bq Er ENOTTY 107The specified request does not apply to the kind 108of object that the descriptor 109.Fa d 110references. 111.It Bq Er EINVAL | 108is not associated with a character 109special device. 110.It Bq Er ENOTTY 111The specified request does not apply to the kind 112of object that the descriptor 113.Fa d 114references. 115.It Bq Er EINVAL |
116The |
|
112.Fa request 113or 114.Fa argp | 117.Fa request 118or 119.Fa argp |
120argument |
|
115is not valid. 116.It Bq Er EFAULT | 121is not valid. 122.It Bq Er EFAULT |
123The |
|
117.Fa argp | 124.Fa argp |
125argument |
|
118points outside the process's allocated address space. 119.El 120.Sh SEE ALSO 121.Xr execve 2 , 122.Xr fcntl 2 , 123.Xr intro 4 , 124.Xr tty 4 125.Sh HISTORY 126The 127.Fn ioctl 128function appeared in 129.At v7 . | 126points outside the process's allocated address space. 127.El 128.Sh SEE ALSO 129.Xr execve 2 , 130.Xr fcntl 2 , 131.Xr intro 4 , 132.Xr tty 4 133.Sh HISTORY 134The 135.Fn ioctl 136function appeared in 137.At v7 . |