ioctl.2: minor doc clarification

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ioctl.2: minor doc clarification

kremlin
ioctl param is always a pointer, previous wording implied int literal
could be passed (results in EFAULT)


Index: ioctl.2
===================================================================
RCS file: /cvs/src/lib/libc/sys/ioctl.2,v
retrieving revision 1.18
diff -u -p -r1.18 ioctl.2
--- ioctl.2 27 Jun 2014 21:06:33 -0000 1.18
+++ ioctl.2 5 Jul 2016 00:12:27 -0000
@@ -60,7 +60,7 @@ to perform the requested function.
 .Fa arg
 is either an
 .Li int
-or a pointer to a device-specific data structure, depending upon
+pointer or a pointer to a device-specific data structure, depending upon
 the given
 .Fa request .
 .Pp

Reply | Threaded
Open this post in threaded view
|

Re: ioctl.2: minor doc clarification

Theo de Raadt
Incorrect.

It is up to the in-kernel ioctl code for each fd (decides subsystem)
and command to decide what it means.  Quite a few of them do take int.

Anways, I'll quote POSIX:

    The arg argument represents additional information that is needed by
    this specific STREAMS device to perform the requested function. The
    type of arg depends upon the particular control request, but it shall
    be either an integer or a pointer to a device-specific data structure.
              ^^^^^^^^^^

> ioctl param is always a pointer, previous wording implied int literal
> could be passed (results in EFAULT)
>
>
> Index: ioctl.2
> ===================================================================
> RCS file: /cvs/src/lib/libc/sys/ioctl.2,v
> retrieving revision 1.18
> diff -u -p -r1.18 ioctl.2
> --- ioctl.2 27 Jun 2014 21:06:33 -0000 1.18
> +++ ioctl.2 5 Jul 2016 00:12:27 -0000
> @@ -60,7 +60,7 @@ to perform the requested function.
>  .Fa arg
>  is either an
>  .Li int
> -or a pointer to a device-specific data structure, depending upon
> +pointer or a pointer to a device-specific data structure, depending upon
>  the given
>  .Fa request .
>  .Pp
>