/* * Outro exemplo de arquivo mapeado em memória. */ #include #include #include #include #include #include int main() { int fd; char* map, *str = "Outra string \n"; fd = open("teste.txt", O_RDWR); map = mmap (NULL, 100, PROT_WRITE, MAP_SHARED, fd, 0); strcpy(map, str); munmap(map, 100); close(fd); return 0; }