about summary refs log tree commit diff
path: root/library/std/src/sys/fs
AgeCommit message (Collapse)AuthorLines
2025-03-18Windows: fix FileType PartialEq implementationChris Denton-18/+15
2025-03-18std: uefi: fs: Implement mkdirAyush Singh-4/+30
- Since there is no direct mkdir in UEFI, first check if a file/dir with same path exists and then create the directory. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-18Rollup merge of #138301 - thaliaarchi:io-optional-methods/hermit, r=tgross35Matthias Krüger-1/+1
Implement `read_buf` for Hermit Following https://github.com/hermit-os/kernel/pull/1606, it is now safe to implement `Read::read_buf` for file descriptors on Hermit. cc ```@mkroening```
2025-03-18Auto merge of #135368 - Ayush1325:uefi-fs-2, r=jhpratt,nicholasbishopbors-2/+138
uefi: fs: Implement exists Also adds the initial file abstractions. The file opening algorithm is inspired from UEFI shell. It starts by classifying if the Path is Shell mapping, text representation of device path protocol, or a relative path and converts into an absolute text representation of device path protocol. After that, it queries all handles supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and opens the volume that matches the device path protocol prefix (similar to Windows drive). After that, it opens the file in the volume using the remaining pat. It also introduces OwnedDevicePath and BorrowedDevicePath abstractions to allow working with the base UEFI and Shell device paths efficiently. DevicePath in UEFI behaves like an a group of nodes laied out in the memory contiguously and thus can be modeled using iterators. This is an effort to break the original PR (https://github.com/rust-lang/rust/pull/129700) into much smaller chunks for faster upstreaming.
2025-03-18uefi: fs: Implement existsAyush Singh-2/+138
Also adds the initial file abstractions. The file opening algorithm is inspired from UEFI shell. It starts by classifying if the Path is Shell mapping, text representation of device path protocol, or a relative path and converts into an absolute text representation of device path protocol. After that, it queries all handles supporting EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and opens the volume that matches the device path protocol prefix (similar to Windows drive). After that, it opens the file in the volume using the remaining pat. It also introduces OwnedDevicePath and BorrowedDevicePath abstractions to allow working with the base UEFI and Shell device paths efficiently. DevicePath in UEFI behaves like an a group of nodes laied out in the memory contiguously and thus can be modeled using iterators. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-17Implement read_buf for HermitThalia Archibald-1/+1
2025-03-17Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboetJacob Pratt-1/+10
Add std support to cygwin target
2025-03-12Rollup merge of #138269 - Ayush1325:uefi-fs-permission, r=joboetMatthias Krüger-64/+35
uefi: fs: Implement FileType, FilePermissions and FileAttr - In UEFI, both FileType and FilePermissions are represented by the attr bitfield. - Using simple bools here since both are represented by a single bit. - Add `FILE_PERMISSION` mask for constructing attribute while change permissions. cc ````@nicholasbishop````
2025-03-11Rollup merge of #138002 - 1c3t3a:fix-std-cfi-violation, r=rcvalleMatthias Krüger-0/+14
Disable CFI for weakly linked syscalls Currently, when enabling CFI via -Zsanitizer=cfi and executing e.g. std::sys::random::getrandom, we can observe a CFI violation. This is the case for all consumers of the std::sys::pal::weak::syscall macro, as it is defining weak functions which don't show up in LLVM IR metadata. CFI fails for all these functions. Similar to other such cases in https://github.com/rust-lang/rust/issues/115199, this change stops emitting the CFI typecheck for consumers of the macro via the `#[no_sanitize(cfi)]` attribute. r? ``````@rcvalle``````
2025-03-10Fix code style王宇逸-1/+6
2025-03-10Initial STD support for Cygwin王宇逸-1/+5
Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
2025-03-10Add comments for #[no_sanitize(cfi)] in stdlibBastian Kersting-0/+2
2025-03-10Disable CFI for weakly linked syscallsBastian Kersting-0/+12
Currently, when enabling CFI via -Zsanitizer=cfi and executing e.g. std::sys::random::getrandom, we can observe a CFI violation. This is the case for all consumers of the std::sys::pal::weak::weak macro, as it is defining weak functions which don't show up in LLVM IR metadata. CFI fails for all these functions. Similar to other such cases in https://github.com/rust-lang/rust/issues/115199, this change stops emitting the CFI typecheck for consumers of the macro via the \#[no_sanitize(cfi)] attribute.
2025-03-10uefi: fs: Partially implement FileAttrAyush Singh-15/+11
- Just the permission and file type. - FileTimes will need some new conversion functions and thus will come with a future PR. Trying to keep things simple here. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-10uefi: fs: Implement FileTypeAyush Singh-30/+10
- Similar to FilePermissions, using bool to represent the bitfield. - FileType cannot be changed, so no need to worry about converting back to attribute. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-10uefi: fs: Implement FilePermissionAyush Singh-21/+16
- UEFI file permissions are indicated using a u64 bitfield used for readonly/filetype, etc. - Using normal bool with to and from attribute conversions to FilePermission from overriding some other bitfields. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-03-09Support File::seek for HermitThalia Archibald-3/+3
2025-03-08Move fs into sysThalia Archibald-0/+7124