def METHOD_NAME(self, b):
    if self.mode != self.READ:
        import errno
        raise OSError(
            errno.EBADF, "read() on write-only %s object" % self.__class__.__name__
        )
    size = self.pipe.METHOD_NAME(b)
    if size == 0:
        self._check_process()
    return size