diff options
Diffstat (limited to 'userspace/cat.c')
| -rw-r--r-- | userspace/cat.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/userspace/cat.c b/userspace/cat.c index a371397..8980546 100644 --- a/userspace/cat.c +++ b/userspace/cat.c @@ -2,16 +2,14 @@ int main() { - FILE *f = fopen("README", "r"); - if (f == NULL) - { - perror("unable to open file"); - return 1; - } - puts("open success"); - fclose(f); + char buf[256]; + + while(has_data_waiting(2)){ + fread(buf,1,5,stderr); // read stderr; + printf("[%s]\n",buf); + } return 0; } |
