Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys - document generic ioctls.



details:   https://anonhg.NetBSD.org/src/rev/4642b64ff723
branches:  trunk
changeset: 535166:4642b64ff723
user:      yamt <yamt%NetBSD.org@localhost>
date:      Sun Aug 11 12:40:46 2002 +0000

description:
- document generic ioctls.
- mention EFAULT.
from OpenBSD.

diffstat:

 lib/libc/sys/ioctl.2 |  55 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 53 insertions(+), 2 deletions(-)

diffs (83 lines):

diff -r 62b3f00ba07e -r 4642b64ff723 lib/libc/sys/ioctl.2
--- a/lib/libc/sys/ioctl.2      Sun Aug 11 12:36:21 2002 +0000
+++ b/lib/libc/sys/ioctl.2      Sun Aug 11 12:40:46 2002 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ioctl.2,v 1.12 2002/02/08 01:28:18 ross Exp $
+.\"    $NetBSD: ioctl.2,v 1.13 2002/08/11 12:40:47 yamt Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"    The Regents of the University of California.  All rights reserved.
@@ -33,7 +33,7 @@
 .\"
 .\"     @(#)ioctl.2    8.2 (Berkeley) 12/11/93
 .\"
-.Dd December 11, 1993
+.Dd August 11, 2002
 .Dt IOCTL 2
 .Os
 .Sh NAME
@@ -72,6 +72,54 @@
 .Fa request
 are located in the file
 .Ao Pa sys/ioctl.h Ac .
+.Sh GENERIC IOCTLS
+Some ioctls are applicable to any file descriptor.
+These include:
+.Bl -tag -width "xxxxxx"
+.It Dv FIOCLEX
+Set close-on-exec flag.
+The file will be closed when
+.Xr exec 3
+is invoked.
+.It Dv FIONCLEX
+Clear close-on-exec flag.
+The file will remain open across
+.Xr exec 3 .
+.El
+.Pp
+Some generic ioctls are not implemented for all types of file
+descriptors.
+These include:
+.Bl -tag -width "xxxxxx"
+.It Dv FIONREAD "int"
+Get the number of bytes that are immediately available for reading.
+.It Dv FIONBIO "int"
+Set non-blocking I/O mode if the argument is non-zero.
+In non-blocking mode,
+.Xr read 2
+or
+.Xr write 2
+calls return \-1 and set
+.Va errno
+to
+.Er EAGAIN
+immediately when no data is available.
+.It Dv FIONASYNC "int"
+Set asynchronous I/O mode if the argument is non-zero.
+In asynchronous mode, the process or process group specified by
+.Dv FIOSETOWN
+will start receiving
+.Dv SIGIO
+signals when data is available.
+The
+.Dv SIGIO
+signal will be delivered when data is available on the file
+descriptor.
+.It Dv FIOSETOWN, FIOGETOWN "int"
+Set/get the process or the process group (if negative) that should receive
+.Dv SIGIO
+signals when data is available.
+.El
 .Sh RETURN VALUES
 If an error has occurred, a value of -1 is returned and
 .Va errno
@@ -97,6 +145,9 @@
 or
 .Fa argp
 is not valid.
+.It Bq Er EFAULT
+.Fa argp
+points outside the process's allocated address space.
 .El
 .Sh SEE ALSO
 .Xr mt 1 ,



Home | Main Index | Thread Index | Old Index