Code dealing with files and separate lines in them
the posted code does not cleanly compile!  

Compile with warnings enabled, then fix those warnings.  

for gcc, at a minimum use: 

-Wall -Wextra -Wconversion -pedantic -std=gnu11


Note: other compilers use different options to produce the same results.

in function: setup_myfile()  there are statements like:

return -1;


However, that only gets execution back to the call in main()

setup_myfile(argv[1], &amp;my_file);


Which is ignoring the returned value.  So, when setup_myfile() fails, main() will keep right on executing, as if everything is OK.

Suggest, rather than: return -1;  to use:

exit( EXIT_FAILURE );


which will properly exit the program

regarding:

file-&gt;size = st.st_size;


This is performing an implicit conversion from off_t to unsigned long int.  Probably better to declare file-&gt;size as an off_t.