9 int main(int argc
, char **argv
)
16 fprintf(stderr
, "usage: %s <path>\n", argv
[0]);
22 /* attributes: EFI_VARIABLE_NON_VOLATILE |
23 * EFI_VARIABLE_BOOTSERVICE_ACCESS |
24 * EFI_VARIABLE_RUNTIME_ACCESS
26 *(uint32_t *)buf
= 0x7;
29 /* create a test variable */
30 fd
= open(path
, O_WRONLY
| O_CREAT
);
32 perror("open(O_WRONLY)");
36 rc
= write(fd
, buf
, sizeof(buf
));
37 if (rc
!= sizeof(buf
)) {
44 fd
= open(path
, O_RDONLY
);
50 if (unlink(path
) < 0) {
55 rc
= read(fd
, buf
, sizeof(buf
));
57 fprintf(stderr
, "reading from an unlinked variable "
58 "shouldn't be possible\n");