fixed bug due to assumption that 'str' is the same as 'struct iovec' (used by writev).