fdt_appendprop_u64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fdt_appendprop_u64 β€” from the Kernel API Manual, section 9, no cap

Ok so bestie, buckle up, because we're diving into fdt_appendprop_u64(9) β€” a real one from the Kernel API Manual, section 9. It's giving "tiny function, big responsibilities" and honestly? Obsessed. πŸ’–


✨ NAME ✨

fdt_appendprop_u64 β€” append a 64-bit integer value to a property. That's it, that's the whole gig. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int fdt_appendprop_u64 (void *fdt , int nodeoffset , const char *name ,
       uint64_t val );

Like, look at that signature. So clean. So crisp. 🌸


πŸ’œ ARGUMENTS πŸ’œ

  • fdt β€” pointer to the device tree blob. Yes bestie, the whole blob. The main character. πŸ‘‘
  • nodeoffset β€” offset of the node whose property you're changing. Like a little GPS coordinate but for the node you care about.
  • name β€” name of the property you're changing, in case there was any doubt.
  • val β€” the 64-bit integer value to append to the property (native endian). Keep it, hold it, love it. 🫢

πŸ”₯ DESCRIPTION πŸ”₯

So here's the vibe: fdt_appendprop_u64 appends the given 64-bit integer value β€” converting to big-endian if necessary, because we gotta respect the blob's endianness ✨ β€” to the value of the named property in the given node. Or! If that property doesn't already exist? It just creates a new one with that value. Making it happen from scratch, main character energy. πŸ’…

⚠️ Heads up though β€” this function may insert data into the blob, and will therefore change the offsets of some existing nodes. So like, don't go clutching onto old offsets, because they might literally not be valid anymore. 😭

⭐ RETURN ⭐

The numbers, bestie:

  • 0 β€” on success πŸŽ‰
  • -FDT_ERR_NOSPACE β€” there is insufficient free space in the blob to contain the new property value
  • -FDT_ERR_BADOFFSET β€” nodeoffset did not point to FDT_BEGIN_NODE tag
  • -FDT_ERR_BADLAYOUT
  • -FDT_ERR_BADMAGIC
  • -FDT_ERR_BADVERSION
  • -FDT_ERR_BADSTATE
  • -FDT_ERR_BADSTRUCTURE
  • -FDT_ERR_BADLAYOUT β€” yes, it really is listed twice πŸ˜… iconic of it honestly
  • -FDT_ERR_TRUNCATED
  • …and all those last ones have their standard meanings, iykyk.

🌈 SEE ALSO 🌈

The kernel file over at ./scripts/dtc/libfdt/libfdt.h says hi, and so do literally all of these besties ✨:


🫢 That's the whole page, bestie. Now go forth and append those 64-bit integers. Slay. πŸ’…βœ¨

β€” lovingly delivered to you from ./scripts/dtc/libfdt, dated October 2026, section 9 forever πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from