--- libaitio/example/test_exec.c 2013/12/06 01:03:02 1.1.2.7 +++ libaitio/example/test_exec.c 2013/12/06 01:07:40 1.1.2.9 @@ -10,7 +10,7 @@ int main(int argc, char **argv) { prog_t *p; - FILE *f; + int f; int ret = 0; char str[BUFSIZ]; @@ -51,13 +51,14 @@ main(int argc, char **argv) again: f = io_progAttach(p); - printf("f=%p\n", f); - while (read(fileno(f), str, sizeof str) > 0) { + printf("f=%d\n", f); + write(f, "v\n", 2); + while (read(f, str, sizeof str) > 0) { printf(">>> %s", str); - fgets(str, sizeof str, stdin); + read(0, str, sizeof str); if (*str == '.') break; - write(fileno(f), str, strlen(str)); + write(f, str, strlen(str)); } io_progDetach(p, f);