In net read and write functions preserve errno.