Re: losetup and dev_t

Martin von Loewis (martin@mira.isdn.cs.tu-berlin.de)
Wed, 28 Jan 1998 08:26:20 +0100


> For the time being this probably means that one has to do
> sed 's/dev_t/unsigned short/'
> when using kernel include files that will be compiled with glibc.

Why not use kdev_t?

> This means that all relevant ioctl numbers will have to change.
> Maybe it would be nice for security if there were a guarantee
> about the amount of memory written by the kernel, so that it
> would be impossible to crash a well-written application on a
> more recent kernel. Perhaps something like
>
> linuxioctl( int ioctl, int *version, int *length, void *data );

The traditional approach would be to put this into the structure of
the plain old ioctl(2):

struct foo{
unsigned short size;
unsigned short version;
other data;
};
struct foo x;
x.size=sizeof(x);
x.version=1;
ioctl...

Regards,
Martin