MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Read

Function Read

Kernel/src/fs/initrd.cpp:82–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 size_t Read(fs_node_t* node, size_t offset, size_t size, uint8_t *buffer){
83 lemoninitfs_node_t inode = nodes[node->inode];
84
85 if(offset > inode.size) return 0;
86 else if(offset + size > inode.size || size > inode.size) size = inode.size - offset;
87
88 if(!size) return 0;
89
90 memcpy(buffer, (void*)((uintptr_t)inode.offset + (uintptr_t)initrd_address + offset), size);
91 return size;
92 }
93
94 size_t Write(fs_node_t* node, size_t offset, size_t size, uint8_t *buffer){
95 return 0; // It's a ramdisk.

Callers 3

ReadMethod · 0.70
KernelProcessFunction · 0.50
kmainFunction · 0.50

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected