Re: [PATCH] new system call mknod64

jw schultz
2003-04-22T05:50:51Z

On Mon, Apr 21, 2003 at 07:52:04PM -0700, H. Peter Anvin wrote:
> Jamie Lokier wrote:
> >>
> >>The main advantage with making it a struct is that it keep people from
> >>doing stupid stuff like (int)dev where dev is a kdev_t... There is
> >>all kinds of shit like that in the kernel...
> >
> > If you want that good quality 64-bit code, try making it a struct
> > containing just a u64 :)
> >
>
> Perhaps:
>
> #if BITS_PER_LONG == 64
> typedef struct { u64 val; } kdev_t;
>
> /* Macros for major minor mkdev */
> #else
> typedef struct { u32 major, minor; } kdev_t;
>
> /* Macros... */
> #endif
>

or a union?
typedef union { u64 dev; struct { u32 major, minor; } d; } kdev_t;

<duck>

--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw@pegasys.ws

Remember Cernan and Schmitt