I would like to request a fundamental change, to a minor part of the DRM API.
I believe that the current semantics of ioctl(DRM_IOCTL_SET_UNIQUE) and ioctl(DRM_IOCTL_GET_UNIQUE), violate POSIX/SUS understanding of the ioctl command. To quote from the single unix specification version 2 (1997) http://www.opengroup.org/onlinepubs/007908799/xsh/ioctl.html ".... 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 is either an integer or a pointer to a device-specific data structure." It is NOT expected that you pass in "a pointer to a structure that has a pointer". You are not supposed to pass in arbitrary pointers to userspace for manipulation by the kernel. The original reason for this was that ioctls were supposed to be STREAMS messages. You put together a little "packet", that contains either an integer value, or a structure, and then the data packet gets sent upstream, and the kernel interprets the datapacket. Or you request a datapacket, and the kernel sends a packet downstream to you. Everything is supposed to be self-contained in the packet. Bringing the API in line with traditional UNIX ioctl behaviour, makes it easier to port the drm driver to other architectures. My proposal is to change, in drm.h typedef struct drm_unique { size_t unique_len; /* Length of unique */ char *unique; /* Unique name for driver instantiation */ } drm_unique_t; to be typedef struct drm_unique { size_t unique_len; /* Length of unique */ char unique[DRM_UNIQUE_MAX]; /* Unique name for driver instantiation */ } drm_unique_t; The caller is then responsible for copying the string in and out of the struct as appropriate. ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel