is_gpt_valid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so we're deep in the Kernel API Manual, and today's main character is is_gpt_valid(9) β€” it tests one GPT header and PTEs for validity. that's the whole assignment, bestie: one GPT header + PTEs, validity check, slay. ✨

✨ SYNOPSIS ✨

int is_gpt_valid (struct parsed_partitions *state , u64 lba , gpt_header
**gpt , gpt_entry **ptes );

πŸŽ€ ARGUMENTS πŸŽ€

  • state β€” the disk's parsed partitions, aka the struct parsed_partitions *state situation. 🫢
  • lba β€” logical block address of the GPT header to test. yep, that exact header. πŸ‘‘
  • gpt β€” GPT header ptr, filled on return. so it's gpt_header **gpt, and it gets filled when the function comes back. πŸ’…
  • ptes β€” PTEs ptr, filled on return. that's gpt_entry **ptes, also filled on return. πŸŽ€

πŸ¦‹ DESCRIPTION πŸ¦‹

returns 1 if valid, 0 on error. no cap. πŸ”₯

If valid, it returns pointers to newly allocated GPT header and PTEs. that's the win condition, and it's giving "here are your fresh pointers, bestie." πŸ’–

heads up: 1 means valid, 0 means error β€” don't flip it, iykyk. 😭

🌈 SEE ALSO 🌈

Kernel file ./block/partitions/efi.c is right there in the group chat, and these besties are also linked:


cute sign-off: this page came from ./block/partitions β€” October 2026 edition β€” and yes, it ate. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from