Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

efi_setvar(3) [freebsd man page]

LIBEFI(3)						   BSD Library Functions Manual 						 LIBEFI(3)

efi_getvar, efi_nextvarname, efi_setvar -- interface for accessing the EFI variable services LIBRARY
library ``libefi'' SYNOPSIS
#include <libefi.h> int efi_getvar(char *name, uuid_t *vendor, uint32_t *attrib, size_t *datasize, void *data); int efi_nextvarname(size_t *namesize, char *name, uuid_t *vendor); int efi_setvar(char *name, uuid_t *vendor, uint32_t attrib, size_t datasize, void *data); DESCRIPTION
The libefi library provides access to a select set of the runtime services of the Extensible Firmware Interface (EFI). The efi_nextvarname() function is used to enumerate the variables. The namesize parameter needs to be set to the size of the buffer pointed to by name. On return, namesize is set to the length of the variable name (including the terminating '') irrespective of whether the buf- fer was big enough. The buffer pointed to by name contains the full or partial variable name on return. Only on successful completion of the request is the vendor updated. The values returned should be passed to successive calls to efi_nextvarname() until all variables have been enumerated. The variable name and vendor as returned by efi_nextvarname() can be passed to efi_getvar() to obtain the value and attribute of the vari- able. The buffer that is to contain the value is specified by data and the size of the buffer is given by datasize. The attribute pointed to by attrib consists of the bit values defined by the EFI specification. Variables can be created, modified and deleted using the efi_setvar() function. All new variables must be non-volatile and runtime accessi- ble in order for the request to succeed. Note that for runtime accessable variables the boottime accessable bit must be set as well. To delete a variable, set datasize to 0. The vendor UUID is used to avoid collisions between variable names of different vendors. Variables created for use by FreeBSD should use the EFI_FREEBSD_VARIABLE UUID as defined in the <libefi.h> header file. RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, the error number is returned. These functions will fail if: [EACCES] Insufficient permissions to access the EFI services. [EILSEQ] The variable name is not in UTF-8. [EINVAL] The request has invalid parameters. [ENOENT] The variable does not exist or no more variables exist. [ENOMEM] Temporary storage could not be allocated. [EOVERFLOW] The variable name is too long or the data is too big to fit in the buffer provided. SEE ALSO
errno(2), uuid(3) HISTORY
The libefi library first appeared in FreeBSD 9.0 for the ia64 architecture. AUTHORS
The libefi library and this manual page were written by Marcel Moolenaar <>. BSD
January 29, 2010 BSD

Check Out this Related Man Page

UUID(3) 						   BSD Library Functions Manual 						   UUID(3)

uuid_compare, uuid_create, uuid_create_nil, uuid_equal, uuid_from_string, uuid_hash, uuid_is_nil, uuid_to_string -- DCE 1.1 compliant UUID functions LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <uuid.h> int32_t uuid_compare(const uuid_t *uuid1, const uuid_t *uuid2, uint32_t *status); void uuid_create(uuid_t *uuid, uint32_t *status); void uuid_create_nil(uuid_t *uuid, uint32_t *status); int32_t uuid_equal(const uuid_t *uuid1, const uuid_t *uuid2, uint32_t *status); void uuid_from_string(const char *str, uuid_t *uuid, uint32_t *status); uint16_t uuid_hash(const uuid_t *uuid, uint32_t *status); int32_t uuid_is_nil(const uuid_t *uuid, uint32_t *status); void uuid_to_string(const uuid_t *uuid, char **str, uint32_t *status); void uuid_enc_le(void *buf, const uuid_t *uuid); void uuid_dec_le(const void *buf, uuid_t *); void uuid_enc_be(void *buf, const uuid_t *uuid); void uuid_dec_be(const void *buf, uuid_t *); DESCRIPTION
The family of DCE 1.1 compliant UUID functions allow applications to operate on universally unique identifiers, or UUIDs. The uuid_create() and uuid_create_nil() functions create UUIDs. The uuid_compare(), uuid_equal() and uuid_is_nil() functions can be used to test UUIDs. To convert from the binary representation to the string representation or vice versa, use uuid_to_string() or uuid_from_string() respectively. A 16-bit hash value can be obtained by calling uuid_hash(). The uuid_to_string() function set *str to be a pointer to a buffer sufficiently large to hold the string. This pointer should be passed to free(3) to release the allocated storage when it is no longer needed. The uuid_enc_le() and uuid_enc_be() functions encode a binary representation of a UUID into an octet stream in little-endian and big-endian byte-order, respectively. The destination buffer must be pre-allocated by the caller, and must be large enough to hold the 16-octet binary UUID. These routines are not part of the DCE RPC API. They are provided for convenience. The uuid_dec_le() and uuid_dec_be() functions decode a UUID from an octet stream in little-endian and big-endian byte-order, respectively. These routines are not part of the DCE RPC API. They are provided for convenience. RETURN VALUES
The successful or unsuccessful completion of the function is returned in the status argument. Possible values are: uuid_s_ok The function completed successfully. uuid_s_bad_version The UUID does not have a known version. uuid_s_invalid_string_uuid The string representation of an UUID is not valid. uuid_s_no_memory The function can not allocate memory to store an UUID representation. SEE ALSO
uuidgen(1), uuidgen(2) STANDARDS
The UUID functions conform to the DCE 1.1 RPC specification. BUGS
This manpage can be improved. BSD
March 1, 2012 BSD
Man Page