You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constDIRENT_HEADER_START:usize = std::mem::offset_of!(libc::dirent64, d_name) + 1;//we're going backwards(to the start of d_name) so we add 1 to the offset
385
-
let reclen = unsafe{(*dirent).d_reclenasusize};//THIS MACRO IS MODIFIED FROM THE STANDARD LIBRARY INTERNAL IMPLEMENTATION
386
-
//an internal macro, alternatively written as (my macro just makes it easy to access without worrying about alignment)
387
-
// let reclen = unsafe { (*dirent).d_reclen as u16 }; (do not access it via byte_offset!)
388
-
// Calculate find the start of the d_name field
382
+
let reclen = unsafe{(*dirent).d_reclenasusize};
383
+
//find the record-length
389
384
// THIS WILL ONLY WORK ON LITTLE-ENDIAN ARCHITECTURES, I CANT BE BOTHERED TO FIGURE THAT OUT, qemu isnt fun
390
-
// Calculate find the start of the d_name field
385
+
// Calculate the start of the d_name field
391
386
let last_word = unsafe{*((dirent as*constu8).add(reclen - 8)as*constu64)};
392
387
// Special case: When processing the 3rd u64 word (index 2), we need to mask
393
388
// the non-name bytes (d_type and padding) to avoid false null detection.
0 commit comments