Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

822
Views
why is u8 u16 u32 u64 used instead of unsigned int in kernel programming

I see u8 u16 u32 u64 data types being used in kernel code. And I am wondering why is there need to use u8 or u16 or u32 or u64 and not unsigned int?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Often when working close to the hardware or when trying to control the size/format of a data structure you need to have precise control of the size of your integers.

As for u8 vs uint8_t, this is simply because Linux predated <stdint.h> being available in C, which is technically a C99-ism, but in my experience is available on most modern compilers even in their ANSI-C / C89 modes.

over 4 years ago · Santiago Trujillo Report

0

Adding my 10 cents to this answer:

u64 means an 'unsigned 64 bits' value, so, depending on the architecture where the code will run/be compiled, it must be defined differently in order to really be 64 bits long.

For instance, on a x86 machine, an unsigned long is 64 bits long, so u64 for that machine could be defined as follows:

typedef unsigned long u64;

The same applies for u32. On a x86 machine, unsigned int is 32 bits long, so u32 for that machine could be defined as follows:

typedef unsigned int u32;

You'll generally find the typedef declaration for these types on a types.h file which corresponds to the architecture you're compiling your source to.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!