Change "nbytes" to "buflen" to be consistent with read and since "buflen" is used in the documentation here.