Re: Please remove all bit fields in bpf uapi

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

 



On 12/18/20 12:04 PM, Florian Weimer wrote:
On Fri, Dec 18, 2020 at 05:09:58PM +0800, Meng Zhuo wrote:
Hi, Greg

Thank you for your reply
It's fine to do compile bit fields "by hand".

Surely Go has something like "if (field & 0x01)", right?  That's all you
need for a bitfield.

Look at the most common syscall, open(2)?  It uses bitfields, why
can't Go handle that?

Flag arguments are very different from bit-fields in struct types.

Structs with bit-fields are not part of the highly portable C subset.
Even C compilers differ in their interpretation.

Bitfields are still quite common though, not special to BPF in any way ...
how do you deal with all these cases then?

git grep -P -n "[a-z]+:[1-9]+" include/uapi/ | wc -l
272



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux