sandbox: Allow Ctrl-C to work in sandbox

It is useful for Cltl-C to be handled by U-Boot as it is on other boards.
But it is also useful to be able to terminate U-Boot with Ctrl-C.

Add an option to enable signals while in raw mode, and make this the
default. Add an option to leave the terminal cooked, which is useful for
redirecting output.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2014-02-27 13:26:22 -07:00
parent 20f86a0aea
commit ffb87905cb
5 changed files with 69 additions and 8 deletions

View file

@ -103,8 +103,12 @@ void os_exit(int exit_code) __attribute__((noreturn));
/**
* Put tty into raw mode to mimic serial console better
*
* @param fd File descriptor of stdin (normally 0)
* @param allow_sigs Allow Ctrl-C, Ctrl-Z to generate signals rather than
* be handled by U-Boot
*/
void os_tty_raw(int fd);
void os_tty_raw(int fd, bool allow_sigs);
/**
* Acquires some memory from the underlying os.