From 7f41238f706693c423e50b21ed01d5eb7309b9f1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sat, 12 Sep 2015 13:35:48 +0200 Subject: [PATCH] POSIX: Add usleep shell command, add cout flush to exit command --- Tools/posix_apps.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Tools/posix_apps.py b/Tools/posix_apps.py index b7ddbc210c..c8f2c31de9 100755 --- a/Tools/posix_apps.py +++ b/Tools/posix_apps.py @@ -98,7 +98,9 @@ static void list_builtins(void) static int shutdown_main(int argc, char *argv[]) { - cout << "Shutting down" << endl; + cout.flush(); + cout << endl << "Shutting down" << endl; + cout.flush(); exit(0); } @@ -133,5 +135,14 @@ static int sleep_main(int argc, char *argv[]) sleep(atoi(argv[1])); return 0; } +static int usleep_main(int argc, char *argv[]) +{ + if (argc != 2) { + cout << "Usage: usleep " << endl; + return 1; + } + usleep(atoi(argv[1])); + return 0; +} """)