[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return?



Robert Love wrote:
> 
> On Wed, 2003-11-05 at 17:32, Mark Hounschell wrote:
> 
> > Is it possible to have a function return a 64 bit variable using
> >
> >       return 64bitvarname
> 
> Would not it of been infinitely easier to test this yourself instead of
> posting this question?
> 
> Sure, of course you can:
> 
>         unsigned long long parakeet(void)
>         {
>                 unsigned long long x = 55;
> 
>                 return x;
>         }
> 
> Works fine here.
> 
> u64_t ought to work fine, too, if you want _exactly_ 64-bits.
> 
>         Robert Love

Well I'm sorry. I have tried this myself. And if done within a kernel
module it only returns the 32 ls bits. In userland I have no problem
with it. I was hesitant to post it here but since I'm only having a
problem with it in my kernel driver module "ioctl", I did. Try setting x
to 0x0123456789abcdef in a kernel function...

Mark
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/