Out of openat flag space

Kernel Apprentice kernelapprentice at gmail.com
Wed Apr 8 04:52:53 EDT 2015



Am 08.04.2015 um 10:17 schrieb Sudip Mukherjee:
> On Wed, Apr 8, 2015 at 1:30 PM, Kernel Apprentice
> <kernelapprentice at gmail.com> wrote:
>> Hello,
>>
>>> Hello,
>>>
>>> Now that we have O_TMPFILE and O_BENEATH added to the openat flags, there
>>> is no space left to add more flags since the flags variable is a 32 bit
>>> int. How does one resolve this issue and extend this? A new syscall with a
>>> 64bit wide flags support?
>>
>> Maybe I'm missing something, but a signed 32 bit integer variable holds
>> a maximum value of
>>
>>   2,147,483,647
> 
> as far as i know each bit of the number will represent a flag. so a 8
> bit value can have a maximum of 8 flags and not 256 flags . same goes
> for a 32 bit  integer.

Yes of course. But that's not what I meant. If you take the following
hex value that has been used as a flag:

  0x4000000 (= 4 * 16 ^ 6 = 67108864)

which equals

  00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00
  -- -- -

  (= 1 * 2 ^ 26 = 67108864)

in binary, then you can see that there's room for 5 more flags. This is
what I was actually getting at.

But maybe I'm off here.

> 
> regards
> sudip
> 



More information about the Kernelnewbies mailing list