diff options
| author | Miguel <m.i@gmx.at> | 2018-08-18 13:23:53 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-08-18 13:23:53 +0200 |
| commit | 7b0d88b2dff9b635d9ff69f6d51b6832c1ca4c40 (patch) | |
| tree | 22c452e9c7ad586136721e776e0b67b23fb33119 /userspace/cat.c | |
| parent | 17fd357bad5f6c3362cfdab1d807aa463c69a4e9 (diff) | |
cleaning up syscalls and playing with new pipes
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; } |
