Added fcntl.h.
Linking with pthread.