sandbox: Add function os_flush()

It flushes stdout.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Pali Rohár 2022-09-05 11:31:16 +02:00 committed by Tom Rini
parent ca0f827dc7
commit 7df5b35334
2 changed files with 13 additions and 0 deletions

View File

@ -669,6 +669,11 @@ void os_puts(const char *str)
os_putc(*str++);
}
void os_flush(void)
{
fflush(stdout);
}
int os_write_ram_buf(const char *fname)
{
struct sandbox_state *state = state_get_current();

View File

@ -295,6 +295,14 @@ void os_putc(int ch);
*/
void os_puts(const char *str);
/**
* os_flush() - flush controlling OS terminal
*
* This bypasses the U-Boot console support and flushes directly the OS
* stdout file descriptor.
*/
void os_flush(void);
/**
* os_write_ram_buf() - write the sandbox RAM buffer to a existing file
*