zircon/system/core/bootsvc/main.cc
// Wire up stdout so that printf() and friends work.
Wire up stdout so that printf() and friends work.
Wire up stdout so that printf () and friends work .
zx_status_t SetupStdout(const zx::debuglog& log) {
  zx::debuglog dup;
  zx_status_t status = log.duplicate(ZX_RIGHT_SAME_RIGHTS, &dup);
  if (status != ZX_OK) {
    return status;
  }
  fdio_t* logger = nullptr;
  status = fdio_create(dup.release(), &logger);
  if (status != ZX_OK) {
    return status;
  }
  int fd = fdio_bind_to_fd(logger, 1, 0);
  if (fd != 1) {
    return ZX_ERR_BAD_STATE;
  }
  return ZX_OK;
}
zx_status_t SetupStdout ( const zx :: debuglog & log ) { zx :: debuglog dup ; zx_status_t status = log . duplicate ( ZX_RIGHT_SAME_RIGHTS , & dup ) ; if ( status != ZX_OK ) { return status ; } fdio_t * logger = nullptr ; status = fdio_create ( dup . release ( ) , & logger ) ; if ( status != ZX_OK ) { return status ; } int fd = fdio_bind_to_fd ( logger , 1 , 0 ) ; if ( fd != 1 ) { return ZX_ERR_BAD_STATE ; } return ZX_OK ; }
Wire up stdout so that printf() and friends work.
Wire up stdout so that printf () and friends work .