converting pug to use GNU extensions fseeko / ftello