sandbox: Add function os_flush()
authorPali Rohár <pali@kernel.org>
Mon, 5 Sep 2022 09:31:16 +0000 (11:31 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 24 Sep 2022 14:47:01 +0000 (10:47 -0400)
It flushes stdout.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
arch/sandbox/cpu/os.c
include/os.h

index f937991..01845e3 100644 (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();
index 1481787..5b353ae 100644 (file)
@@ -296,6 +296,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
  *
  * @fname:     filename to write memory to (simple binary format)