efi_variables_supported, efi_del_variable, efi_get_variable, efi_get_variable_attributes,
Contents
Description
efi_variables_supported() tests if the UEFI variable facility is supported on the current machine.
efi_del_variable() deletes the variable specified by guid and name.
efi_get_variable() gets the variable specified by guid and name. The value is stored in data, its size in
data_size, and its attributes are stored in attributes.
efi_get_variable_attributes() gets attributes for the variable specified by guid and name.
efi_get_variable_exists() gets if the variable specified by guid and name exists.
efi_get_variable_size() gets the size of the data for the variable specified by guid and name.
efi_append_variable() appends data of size size to the variable specified by guid and name.
efi_set_variable() sets the variable specified by guid and name, and sets the file mode to mode, subject
to umask. Note that the mode will not persist across a reboot, and that the permissions only apply if on
systems using efivarfs.
efi_get_next_variable_name() iterates across the currently extant variables, passing back a guid and
name.
efi_str_to_guid() parses a UEFI GUID from string form to an efi_guid_t the caller provides
efi_guid_to_str() Creates a string representation of a UEFI GUID. If sp is NULL, it returns how big the
string would be. If sp is not NULL but *sp is NULL, it allocates a string and returns it with. It is
the caller's responsibility to free this string. If sp is not NULL and *sp is not NULL,
efi_guid_to_str() assumes there is an allocation of suitable size and uses it.
efi_name_to_guid() translates from a well known name to an efi_guid_t the caller provides.
efi_guid_to_name() translates from an efi_guid_t to a well known name. If the supplied GUID does not
have a well known name, this function is equivalent to efi_guid_to_str().
efi_guid_to_id_guid() translates from an efi_guid_t to an {ID GUID}. If the supplied GUID has a well
known name, the {ID GUID} will be of the form "{name_here}". If not, it will be of the form
"{66b2af1c-6211-4082-95cb-9f73a4795a7e}".
efi_id_guid_to_guid() translates from an {ID GUID} to an efi_guid_t the caller provides.
efi_guid_to_symbol() translates from an efi_guid_t to a unique (within libefivar) C-style symbol name.
These symbol names are useful for printing as a unique, easily parsed identifier, and are also provide by
the library and its header files.
efi_symbol_to_guid() translates from a libefivar efi_guid_$FOO symbol name to an efi_guid_t the caller
provides.
Name
efi_variables_supported, efi_del_variable, efi_get_variable, efi_get_variable_attributes,
efi_get_variable_size, efi_set_variable - manipulate UEFI variables
Return Value
efi_variables_supported() returns true if variables are supported on the running hardware, and false if
they are not.
efi_get_next_variable_name() returns 0 when iteration has completed, 1 when iteration has not completed,
and -1 on error. In the event of an error, errno(3) is set appropriately.
efi_del_variable(), efi_get_variable(), efi_get_variable_attributes(), efi_get_variable_exists(),
efi_get_variable_size(), efi_append_variable(), efi_set_variable(), efi_str_to_guid(), efi_guid_to_str(),
efi_name_to_guid(), and efi_guid_to_name() return negative on error and zero on success.
Synopsis
#include<efivar.h>intefi_variables_supported(void);intefi_del_variable(efi_guid_tguid,constchar*name);intefi_get_variable(efi_guid_tguid,constchar*name,void**data,ssize_t*data_size,uint32_t*attributes);intefi_get_variable_attributes(efi_guid_tguid,constchar*name,uint32_t*attributes);intefi_get_variable_exists(efi_guid_tguid,constchar*name);intefi_get_variable_size(efi_guid_tguid,constchar*name,size_t*size);intefi_append_variable(efi_guid_tguid,constchar*name,void*data,size_tdata_size,uint32_tattributes);intefi_set_variable(efi_guid_tguid,constchar*name,void*data,size_tdata_size,uint32_tattributes,mode_tmode);intefi_get_next_variable_name(efi_guid_t**guid,char**name);intefi_str_to_guid(constchar*s,efi_guid_t*guid);intefi_guid_to_str(constefi_guid_t*guid,char**sp);intefi_name_to_guid(constchar*name,efi_guid_t*guid);intefi_id_guid_to_guid(constchar*id_guid,efi_guid_t*guid);intefi_guid_to_name(efi_guid_t*guid,char**name);intefi_guid_to_id_guid(efi_guid_t*guid,char**id_guid);intefi_guid_to_symbol(efi_guid_t*guid,char**symbol);intefi_symbol_to_guid(constchar*symbol,efi_guid_t*guid);
