ftruncate implementation tail