efivar_entry_set_get_size(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… efivar_entry_set_get_size(9) πŸ’…

okay so bestie, we're in the Kernel API Manual and this page is all about one very special (and lowkey complex) function. no cap, it's giving atomic setter-plus-size-getter energy. πŸ¦‹

πŸ“› NAME πŸ“›

efivar_entry_set_get_size β€” call set_variable() and get new size (atomic). ✨

✨ SYNOPSIS ✨

int efivar_entry_set_get_size (struct efivar_entry *entry , u32
attributes , unsigned long *size , void *data , bool *set );

πŸŽ€ ARGUMENTS πŸŽ€

  • entry β€” entry containing variable to set and get. πŸ‘‘
  • attributes β€” attributes of variable to be written. πŸŽ€
  • size β€” size of data buffer. πŸ¦‹
  • data β€” buffer containing data to write. πŸ’–
  • set β€” did the set_variable call succeed? (that's the question, bestie) πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so real talk: this is a pretty special (complex) function. See efivarfs_file_write. πŸ”₯

It atomically calls set_variable for entry, and if the call is successful, returns the new size of the variable from get_variable in size. The success of set_variable is indicated by set. periodt. πŸ’…

Returns 0 on success, -EINVAL if the variable data is invalid, -ENOSPC if the firmware does not have enough available space, or a converted EFI status code if either of set_variable or get_variable fail.

and heads up: if the EFI variable does not exist when calling set_variable (EFI_NOT_FOUND). 🌸

🌈 SEE ALSO 🌈

Kernel file ./fs/efivarfs/vars.c is the homegirl here, and the besties are:


xoxo, your local Unix bestie πŸ’– source/version: ./fs/efivarfs Β· date: October 2026 Β· for efivar_entry_set_get_size(9) πŸŽ€βœ¨

πŸ“¦ where this page comes from