OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [common/] [v2_0/] [doc/] [manpages/] [sys/] [ioctl.2] - Diff between revs 27 and 174

Only display areas with differences | Details | Blame | View Log

Rev 27 Rev 174
.\"     $OpenBSD: ioctl.2,v 1.11 2001/07/30 01:12:43 deraadt Exp $
.\"     $OpenBSD: ioctl.2,v 1.11 2001/07/30 01:12:43 deraadt Exp $
.\"     $NetBSD: ioctl.2,v 1.5 1995/02/27 12:33:47 cgd Exp $
.\"     $NetBSD: ioctl.2,v 1.5 1995/02/27 12:33:47 cgd Exp $
.\"
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" Copyright (c) 1980, 1991, 1993
.\"     The Regents of the University of California.  All rights reserved.
.\"     The Regents of the University of California.  All rights reserved.
.\"
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"    documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" 3. All advertising materials mentioning features or use of this software
.\"    must display the following acknowledgement:
.\"    must display the following acknowledgement:
.\"     This product includes software developed by the University of
.\"     This product includes software developed by the University of
.\"     California, Berkeley and its contributors.
.\"     California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of 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
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"    without specific prior written permission.
.\"
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" 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
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\" SUCH DAMAGE.
.\"
.\"
.\"     @(#)ioctl.2     8.2 (Berkeley) 12/11/93
.\"     @(#)ioctl.2     8.2 (Berkeley) 12/11/93
.\"
.\"
.Dd December 11, 1993
.Dd December 11, 1993
.Dt IOCTL 2
.Dt IOCTL 2
.Os
.Os
.Sh NAME
.Sh NAME
.Nm ioctl
.Nm ioctl
.Nd control device
.Nd control device
.Sh SYNOPSIS
.Sh SYNOPSIS
.Fd #include 
.Fd #include 
.Ft int
.Ft int
.Fn ioctl "int d" "unsigned long request" "..."
.Fn ioctl "int d" "unsigned long request" "..."
.Sh DESCRIPTION
.Sh DESCRIPTION
The
The
.Fn ioctl
.Fn ioctl
function manipulates the underlying device parameters of special files.
function manipulates the underlying device parameters of special files.
In particular, many operating
In particular, many operating
characteristics of character special files (e.g., terminals)
characteristics of character special files (e.g., terminals)
may be controlled with
may be controlled with
.Fn ioctl
.Fn ioctl
requests.
requests.
.Pp
.Pp
The argument
The argument
.Fa d
.Fa d
must be an open file descriptor. The third argument is called
must be an open file descriptor. The third argument is called
.Fa arg
.Fa arg
and contains additional information needed by this device
and contains additional information needed by this device
to perform the requested function.
to perform the requested function.
.Fa arg
.Fa arg
is either an
is either an
.Li int
.Li int
or a pointer to a device-specific data structure, depending upon
or a pointer to a device-specific data structure, depending upon
the given
the given
.Fa request .
.Fa request .
.Pp
.Pp
An
An
.Nm
.Nm
.Fa request
.Fa request
has encoded in it whether the argument is an
has encoded in it whether the argument is an
.Dq in
.Dq in
parameter
parameter
or
or
.Dq out
.Dq out
parameter, and the size of the third argument
parameter, and the size of the third argument
.Pq Fa arg
.Pq Fa arg
in bytes.
in bytes.
Macros and defines used in specifying an ioctl
Macros and defines used in specifying an ioctl
.Fa request
.Fa request
are located in the file
are located in the file
.Ao Pa sys/ioctl.h Ac .
.Ao Pa sys/ioctl.h Ac .
.Sh RETURN VALUES
.Sh RETURN VALUES
If an error has occurred, a value of \-1 is returned and
If an error has occurred, a value of \-1 is returned and
.Va errno
.Va errno
is set to indicate the error.
is set to indicate the error.
.Sh ERRORS
.Sh ERRORS
.Fn ioctl
.Fn ioctl
will fail if:
will fail if:
.Bl -tag -width Er
.Bl -tag -width Er
.It Bq Er EBADF
.It Bq Er EBADF
.Fa d
.Fa d
is not a valid descriptor.
is not a valid descriptor.
.It Bq Er ENOTTY
.It Bq Er ENOTTY
.Fa d
.Fa d
is not associated with a character
is not associated with a character
special device.
special device.
.It Bq Er ENOTTY
.It Bq Er ENOTTY
The specified request does not apply to the kind
The specified request does not apply to the kind
of object that the descriptor
of object that the descriptor
.Fa d
.Fa d
references.
references.
.It Bq Er EINVAL
.It Bq Er EINVAL
.Fa request
.Fa request
or
or
.Fa arg
.Fa arg
is not valid.
is not valid.
.It Bq Er EFAULT
.It Bq Er EFAULT
.Fa arg
.Fa arg
points outside the process's allocated address space.
points outside the process's allocated address space.
.El
.El
.Sh SEE ALSO
.Sh SEE ALSO
.Xr cdio 1 ,
.Xr cdio 1 ,
.Xr chio 1 ,
.Xr chio 1 ,
.Xr mt 1 ,
.Xr mt 1 ,
.Xr execve 2 ,
.Xr execve 2 ,
.Xr fcntl 2 ,
.Xr fcntl 2 ,
.Xr intro 4 ,
.Xr intro 4 ,
.Xr tty 4
.Xr tty 4
.Sh HISTORY
.Sh HISTORY
An
An
.Fn ioctl
.Fn ioctl
function call appeared in
function call appeared in
.At v7 .
.At v7 .
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.