![]() | |||||||||||
Messages in this thread |
On Sünndag 15 Mai 2005 14:02, Benjamin Herrenschmidt wrote: > > > That's even more evil than ioctl()... Try doing 32-vs-64bit conversion > > on write... > > I don't see the problem ... if you are passing a structure, you have to > convert it anyway, and it's bad practice. I was thinking about passing > ascii so it can be controlled by shell scripts. Parsing multi-value ascii data is error prone. in kernel space, I would not want to do anything more complex than a simple_strtoul(), if only for the reason of not giving bad examples. When passing binary structures, there is a significant difference between passing it through ioctl or read/write: We already have a rather complicated method of detecting if whether and how to convert them (f_op->compat_ioctl, hash lookup and the deprecated dynamic registration). For read/write, there is no way to tell if you need to do the conversion, even if the file operation is aware of the actual data layout of both variants. Moreover, a good implementation of a read/write file operation should be able to deal with resuming partial transfers. Regarding the shell scripting possibility, I don't really see the point. The only code that should actually use the kernel interfaces is something like an /lib/ld-spu.so interpreter and that is better implemented in C anyway because it needs to parse ELF structures and such. Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ | ||||||||||
| Last update: 2005-05-15 14:53 [from the cache] ©2003-2008 | |||||||||||