Add #include <unistd.h> to tune.cpp to use function write.