Remote ioctls - [was Re: Adding checkpointing API to Linux kernel]

Larry McVoy (lm@bitmover.com)
Sat, 23 Jan 1999 11:55:40 -0800


: BTW things like network block device would benefit from ioctl's being
: standartized, too. That way, I would be able to pass ioctls across
: network and I would be able to create network char device and play
: sounds over network over it :-).

It's cool to see this, somewhere I have a paper on this I wrote at Sun
when we were thinking about clusters. The bottom line was that we needed
to migrate all the ioctl's to something that passes in a self describing
structure. I think we were looking at using something like the Perl
pack/unpack descriptors which made

struct {
int a;
short b;
char c;
char *d;
long e;
long f[20];
};

turn into

"iscc*ll20"

or something like that. Then ioctl() gets obsoleted by nioctl() which is
sort of like this:

/*
* new ioctl() interface.
* Return value is 0 or -errno where errno is from <net/errno.h>,
* a set of values which are the same on every platform.
*/
int
nioctl( int fd, /* fd, same as ioctl() */
char *inDesc, /* perl like descriptor */
void *inData, /* packed structure */
char *outDesc, /* perl like descriptor */
void **outData) /* packed structure */

The only problem with the interface above is sizes - the kernel needs to
be able to read/write the descriptors and structures. One approach is to
just try it and fault if it doesn't work.

At any rate, it would be very nice to migrate the kernel in this direction.
It makes it possible for clusters to be a lot more complete.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/