Fix the loader/ apps to use fds

This commit is contained in:
Kevin Lange 2012-01-25 14:41:11 -06:00
parent d73d2e2361
commit a0139691dd
3 changed files with 9 additions and 7 deletions

View File

@ -13,9 +13,10 @@ strlen(
}
void usage() {
syscall_print("echo [-n] [-e] [STRING]...\n"
char * str ="echo [-n] [-e] [STRING]...\n"
" -n do not output a new line at the end\n"
" -e process escape sequences\n");
" -e process escape sequences\n";
syscall_write(1, str, strlen(str));
}
int main(int argc, char ** argv) {
@ -58,14 +59,14 @@ int main(int argc, char ** argv) {
}
}
}
syscall_print(argv[i]);
syscall_write(1, argv[i], strlen(argv[1]));
if (i != argc - 1) {
syscall_print(" ");
syscall_write(1, " ", 1);
}
}
if (use_newline) {
syscall_print("\n");
syscall_write(1, "\n", 1);
}
return 0;
}

View File

@ -1,7 +1,8 @@
#include <syscall.h>
int main(int argc, char ** argv) {
syscall_print("Hello world!\n");
char * str = "Hello world!\n";
syscall_write(1 /* stdout */, str, 13);
return 0;
}

View File

@ -119,7 +119,7 @@ int main(int argc, char ** argv) {
if (!nowait) {
int i = syscall_wait(f);
if (i) {
printf("[%d] ");
printf("[%d] ", i);
}
}
free(cmd);