Your C code uses a much larger buffer. Maybe that circumvents some edge case that your Perl logic doesn't handle.
Also, the buffer handling is different between your C and Perl programs. With Perl, you cut from the front of your buffer while with C, you walk a pointer over it. I would rewrite the Perl program to use substr maybe to mimic the C code closer.
Also, is there a reason why you're avoiding readdir?
In reply to Re^3: failing to use getdents system call on Linux
by Corion
in thread failing to use getdents system call on Linux
by glasswalk3r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |