Don't force the caller to initialise the address buffer length
Allow write to return less bytes than we asked for, or zero