check read bytes against len
errno handle and document