this is how you read/write files properly in a linux (or any unix e.g. bsd) userspace application:
mit licensed btw. i plan to make this its own library at some point.
have a nice day
and now that i got this out of my system, i have literally everything else other than editing nvmutil.c to do
browse.libreboot.org
nvmutil.c\nvmutil\util - lbmk.git - libreboot build system (LibreBoot MaKe)