---
name: "efi_get_variable"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["linux", "freebsd"]
url: "https://new.carta.tech/efi_append_variable"
---

# efi\_get\_variable(3)

EFI Non Volatile Variable Support

Part of [efi\_append\_variable(3)](/efi_append_variable/3.md).

## NAME

**libefivar** – EFI Non Volatile Variable Support

## SYNOPSIS

**#include \<efivar.h\>**

*int*\

**efi\_append\_variable**(*efi\_guid\_t guid*, *const char \*name*, *void \*data*, *size\_t data\_size*, *uint32\_t attributes*);

*int*\

**efi\_del\_variable**(*efi\_guid\_t guid*, *const char \*name*);

*int*\

**efi\_get\_variable**(*efi\_guid\_t guid*, *const char \*name*, *void \*\*data*, *ssize\_t \*data\_size*, *uint32\_t \*attributes*);

*int*\

**efi\_get\_variable\_attributes**(*efi\_guid\_t guid*, *const char \*name*, *uint32\_t \*attributes*);

*int*\

**efi\_get\_variable\_size**(*efi\_guid\_t guid*, *const char \*name*, *size\_t \*size*);

*int*\

**efi\_get\_next\_variable\_name**(*efi\_guid\_t \*\*guid*, *char \*\*name*);

*int*\

**efi\_guid\_to\_name**(*efi\_guid\_t \*guid*, *char \*\*name*);

*int*\

**efi\_guid\_to\_symbol**(*efi\_guid\_t \*guid*, *char \*\*symbol*);

*int*\

**efi\_guid\_to\_str**(*const efi\_guid\_t \*guid*, *char \*\*sp*);

*int*\

**efi\_name\_to\_guid**(*const char \*name*, *efi\_guid\_t \*guid*);

*int*\

**efi\_set\_variable**(*efi\_guid\_t guid*, *const char \*name*, *void \*data*, *size\_t data\_size*, *uint32\_t attributes*);

*int*\

**efi\_str\_to\_guid**(*const char \*s*, *efi\_guid\_t \*guid*);

*int*\

**efi\_variables\_supported**(*void*);

## DESCRIPTION

The **libefivar** library implements access to EFI Variables via the EFI Runtime Services. All *char \** strings are converted to 16-bit UTF strings before passing them to EFI.

**efi\_variables\_supported**() returns non-zero if the current machine supports setting of EFI firmware variables and the kernel support for doing so is present. Otherwise zero is returned.

**efi\_del\_variable**() deletes the EFI variable selected by *guid* and *name*.

The following functions have not been implemented yet:

- **efi\_append\_variable**()

- **efi\_get\_next\_variable\_name**()

- **efi\_get\_variable**()

- **efi\_get\_variable\_attributes**()

- **efi\_get\_variable\_size**()

- **efi\_guid\_to\_name**()

- **efi\_guid\_to\_str**()

- **efi\_guid\_to\_symbol**()

- **efi\_name\_to\_guid**()

- **efi\_set\_variable**()

- **efi\_str\_to\_guid**()

## SEE ALSO

[efidev(4)](/efidev/4.md)

## HISTORY

The **libefivar** library first appeared in FreeBSD 12.0.

## AUTHORS

This software was originally written by Warner Losh.

## BUGS

No facilities exist to process the strings as native UTF. This is a limitation in the Linux **libefivar** library interface.
