complilation with

gcc -c -fPIC readfile.c -o readfile.o
gcc -shared -o libreadfile.so readfile.o