#include #include #include #include #include #include #include struct list { char data[500]; }; int main(int argc, char *argv[argc+1]) { size_t len = 100 << 20; int fd = open(argv[1], O_RDONLY); if (fd == -1) { perror("open"); return EXIT_FAILURE; } struct list *items = mmap(NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); if (items == MAP_FAILED) { perror("mmap"); return EXIT_FAILURE; } for (int i = 0; i < 100; i++) { printf("%s\n", items[i].data); } }