We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FileContents::Content
1 parent 20076ad commit f4f4ef2Copy full SHA for f4f4ef2
src/aero_kernel/src/fs/ramfs.rs
@@ -338,6 +338,17 @@ impl INodeInterface for LockedRamINode {
338
Ok(private_cp)
339
}
340
341
+ FileContents::Content(contents) => {
342
+ // TODO: Support shared content ramfs file mappings.
343
+ assert!(!flags.contains(MMapFlags::MAP_SHARED));
344
+
345
+ let private_cp: PhysFrame = FRAME_ALLOCATOR.allocate_frame().unwrap();
346
+ private_cp.as_slice_mut()[..size]
347
+ .copy_from_slice(&contents.lock()[offset..offset + size]);
348
349
+ Ok(private_cp)
350
+ }
351
352
// TODO: Support other memory mapping ramfs files:
353
_ => Err(FileSystemError::NotSupported),
354
0 commit comments