change: use unit size if bufsize argument is nil.