Fixing the pwrite parameter bug. Again. My coding skills are getting really degraded.
Adding support for truncate() and ftruncate() ... hopefully works