This is a bug in your program. You either need to #include <unistd.h>, or cast the second argument of ftruncate(2) to `off_t'. ------------------------------------------------------------------------------