Re: single, comprehensive kernel data types document?

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

 



On Fri, Apr 15, 2016 at 10:09:35AM -0300, Daniel. wrote:
> I've been using *aways* u8, u16, u32 in kernel code (driver code) and
> *aways* __u8, __u16, __u32
> for code that goes to both (usualy ioctl definition headers). What is
> happening here is that __u8 from
> userspace is being "casted" to u8 in driver during an ioctl call, is
> that a problem? This is the "right
> way to do it", right?

Yes, that is correct.

> Also, LDD3 stats this:
> 
> It's important to remember that these types are Linux specific, and
> using them hinders porting software to other Unix flavors. Systems
> with recent compilers support the C99-standard types, such as uint8_t
> and uint32_t; if portability is a concern, those types can be used in
> favor of the Linux-specific variety [1].
> 
> So using C99 standard types for userspace headers (ioctl headers for
> example) are okay!?

No, they aren't, you can not used those types for ioctl headers.

You can get away with using it in kernel-only code, but really, why
would you want to?

thanks,

greg k-h

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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