Used the pwritev() syscall for writing files where possible. It is more effective, because it doesn't require a separate lseek().