dev_set_alias(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dev_set_alias(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” this one's dev_set_alias, and it's genuinely such a little cutie. tiny function, one job, does it well. let's get into it πŸŽ€


πŸ’œ NAME πŸ’œ

dev_set_alias β€” changes the ifalias of a device

πŸ¦‹ SYNOPSIS πŸ¦‹

int dev_set_alias (struct net_device *dev , const char *alias , size_t
len );

like, look at that signature. three args, returns an int, no drama. icon behavior fr πŸ’…

🌸 ARGUMENTS 🌸

  • dev β€” the device. the whole point. the main character of this operation πŸ‘‘
  • alias β€” the name you want, and it can be up to IFALIASZ long. that's the cap, respect the cap πŸŽ€
  • len β€” the limit of bytes to copy from info. so it's not copying everything in sight, just len bytes max. boundaries, we love to see it ✨

⭐ DESCRIPTION ⭐

it sets ifalias for a device. that's it. that's the whole vibe. no cap, it just does the one thing and slays while doing it 🫢

πŸ’– RETURN πŸ’–

  • 0 on success β€” we love a win πŸ’…
  • -errno on failure β€” yeah the sad path, it comes back negative with an errno value 😭

🌈 SEE ALSO 🌈

highkey the whole kernel file ./net/core/dev_api.c is part of this squad, so let's give the siblings their shoutout:

go read them too, they're literally all right there 🧚


πŸ“ reminder: alias only has room for IFALIASZ characters, and len is the byte limit for the copy β€” so don't come in thinking you can drop a whole novel in there.

aaand that's the page bestie! this one lives in ./net/core and it's dated October 2026 β€” shoutout to the Kernel API Manual for hosting it. mwah πŸ’œπŸŽ€βœ¨

πŸ“¦ where this page comes from