Find the answer to your Linux question:
Results 1 to 3 of 3
Was wondering what the symbol ~0UL>>1 really means in regards to kernel-level programming ? I know that the ~ does bitwise inversion and the >>1 does bitshifting by 1 bit, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2004
    Posts
    47

    Question concerning ~0UL>>1


    Was wondering what the symbol ~0UL>>1 really means in regards to kernel-level programming ?

    I know that the ~ does bitwise inversion and the >>1 does bitshifting by 1 bit, but Im a bit uncertain about the 0UL part ?

    Ive googled everywhere and havent really come up with a solid explanation.

    Please reply ASAP since i have to include something about this for an assignment report.

    thanks

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Posts
    575
    UL stands for unsigned long.

  3. #3
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    ~0UL>>1

    creates a bit mask (32 bit machine example) where the high order bit is clear and all the rest of the bits are set:

    Code:
    01111111111111111111111111111111

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •