Use C++11 override keyword with compilers that support it.
Include <unistd.h> to provide declaration of close().