I need to read input from an mmap()'ed file one line at a time. But all the examples I've seen of memory mapping use mmap/memcpy to copy an entire file. Like:
source = mmap(blah, blah...);
destinaton = mmap(blah, blah...);
memcpy(destination, source, ...);
How would I just get one line from the source file? Is it possible to just specify the size of one line (they are all a fixed length, say 10 chars + a newline character) as an argument to mmap()? If so, can I do this in a loop, where the position of the pointer is where it left off during the last read (like when reading a regular file)?