Re: Problem with ioctl command TCGETS

From: Jan Engelhardt
Date: Sun Nov 28 2004 - 05:10:12 EST


>On the subject of ioctls: what about a replacement syscall:
>
> /**
> * Getting and setting file parameters safely (ioctl done right)
> *
> * @fd file descriptor
> * @param name of the parameter to get/set
> * @dir direction flag indicating either get, set, or set-get
> * @value value to set parameter to (set) or store current value into (get)
> * @size size of value
> */
> int fparam(int fd, const char *param, int dir, void *value, size_t size);
>
>I know it's been talked about in the past. Is anyone interested?

The idea is nice, yet the "dir" and "size" parameters in the original _IO*
macros are only there (IMO) to protect against using the wrong value for the
wrong operation on the wrong fd/file/device/socket/etc.

What is the point in making "param" a char*? You would need to parse it down
again.

Oh yeah and call it ioctl2(), sounds more cryptical :)



Jan Engelhardt
--
Gesellschaft fÃr Wissenschaftliche Datenverarbeitung
Am Fassberg, 37077 GÃttingen, www.gwdg.de
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/