-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
UEFI File interface partially unusable #23436
Copy link
Copy link
Closed
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-uefiUnified Extensible Firmware InterfaceUnified Extensible Firmware Interfacestandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behavioros-uefiUnified Extensible Firmware InterfaceUnified Extensible Firmware Interfacestandard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Zig Version
0.15.0-dev.171+1b62a2226
Steps to Reproduce and Observed Behavior
File.openonly allows specifying the modesread,write, orcreate. However these enumerations are for the individual bitfield values, and UEFI only allows specifyingread,read|writeorread|write|create.File.getInfoandFile.setInfouse the size of the struct, howeverInfo.File,Info.FileSystem, andInfo.VolumeLabelare all structs that have a variable width string appended to the end, so@sizeOfdoes not provide the real size of the data. This means thatgetInfowill always returnError.BufferTooSmallandsetInfowill always returnError.BadBufferSize.Expected Behavior
File.open'sOpenModeshould probably just provide enumerations forread,read|writeandread|write|create.File.getInfoneeds to accept a buffer large than theInfo.*struct, the helper method to read the attached string already exists.File.setInfoneeds to accept anInfo.*larger than@sizeOfthat struct. A helper method should likely be added to help construct these types.