diff options
author | Wilbern Cobb <wcobb@cvs.openbsd.org> | 2002-08-08 03:59:58 +0000 |
---|---|---|
committer | Wilbern Cobb <wcobb@cvs.openbsd.org> | 2002-08-08 03:59:58 +0000 |
commit | 9f0b7a65adc0fbf13be93f852aad3692c6e5cfa5 (patch) | |
tree | bc43fe9a80e6eaf7bd225c7470fe5642d409c01a /lib | |
parent | 2cfa566148bfb4cf272fd22a4e9cac25fbdc1a5a (diff) |
document generic ioctls. ok art@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/sys/ioctl.2 | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/lib/libc/sys/ioctl.2 b/lib/libc/sys/ioctl.2 index 4a0d402f990..7397f552c06 100644 --- a/lib/libc/sys/ioctl.2 +++ b/lib/libc/sys/ioctl.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ioctl.2,v 1.12 2002/05/01 08:03:29 mpech Exp $ +.\" $OpenBSD: ioctl.2,v 1.13 2002/08/08 03:59:57 wcobb Exp $ .\" $NetBSD: ioctl.2,v 1.5 1995/02/27 12:33:47 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -83,6 +83,54 @@ Macros and defines used in specifying an ioctl .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 |