Re: Passing struct time_t from kernel to userspace

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

 



Hi...

On Thu, Sep 24, 2009 at 8:48 PM, Leonidas . <leonidas137@xxxxxxxxx> wrote:
>
> Hi
>
> I am passing time_t from kernel space to userspace using ioctl.
> Is this guaranteed to work under most of the cases? Meaning
> would it be possible that time_t in kernel and userspace differ
> on some architectures? I googled about it and I dont see any
> reference to this issue.
>
> For machine in kernelspace time_t is nothing but an unsigned long
> and same is the case of userspace.

Hm, from http://lxr.linux.no/#linux+v2.6.31/arch/x86/include/asm/posix_types_32.h#L21,
I saw that time_t is long, not unsigned long.

About your problem, I think user space and kernel space should always
agree about this time type, no matter what the arch is. But if you
want to be safe, you could always pass variable or flags that tells
kernel space the size of the time variable and whether it's signed or
unsigned.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer
blog: the-hydra.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux