nla_put_64bit(9)
π nla_put_64bit(9) β the Kernel API Manual, bestie edition π
Okay so this is nla_put_64bit, from the kernel API manual (yes, that manual β the one your kernel-dev mutuals keep quoting). It's a tiny lil function with one job and it does it beautifully. Let's get into it β¨
πΈ NAME πΈ
nla_put_64bit β add a netlink attribute to a socket buffer and align it π«
β¨ SYNOPSIS β¨
int nla_put_64bit (struct sk_buff *skb , int attrtype , int attrlen ,
const void *data , int padattr );
That's the whole signature, no cap. Five args, one int coming back at you π«Ά
π¦ ARGUMENTS π¦
skbβ the socket buffer you're adding the attribute to. It's the canvas, she's the main character πattrtypeβ the attribute type. iykyk πattrlenβ length of the attribute payload, fr fr. Measure twice, put once πdataβ head of the attribute payload. Like, the start of it, literally the head πpadattrβ the attribute type used for the padding. Padding has a type and this is it π
π₯ DESCRIPTION π₯
So here's the tea: it returns -EMSGSIZE if the tailroom of the skb is insufficient to store the attribute header and payload π That's it. That's the whole documented behaviour. Not enough tailroom? -EMSGSIZE. Vibe check failed, attribute not added π
ngl, that-EMSGSIZEis a real one β if the tailroom can't hold the attribute header and the payload, that's your error. No silent truncation, no "oops", just-EMSGSIZE. Respect, honestly π
π§ SEE ALSO π§
Kernel file ./lib/nlattr.c β and the whole netlink attribute friend group, all iconic, all listed:
__nla_validate(9)nla_policy_len(9)__nla_parse(9)nla_find(9)nla_strscpy(9)nla_strdup(9)nla_memcpy(9)nla_memcmp(9)nla_strcmp(9)__nla_reserve(9)__nla_reserve_64bit(9)__nla_reserve_nohdr(9)nla_reserve(9)nla_reserve_64bit(9)nla_reserve_nohdr(9)__nla_put(9)__nla_put_64bit(9)__nla_put_nohdr(9)nla_put(9)nla_put_nohdr(9)nla_append(9)
That's twenty-one whole functions, bestie. Go read them all, I believe in you π
And that's the page ππ She lives in ./lib, dated October 2026, and this lil reproduction of nla_put_64bit(9) is officially closed out. Periodt π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms