lkml.org 
[lkml]   [2007]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: cat reading problem
From
Date

> result of strace cat is identical, but in tty case I can't see nothing. Why does cat write nothing at my console?
>
> Thank you,
>
> ------------------------------------------------------------------------------------
>
> root@test:/home# strace cat < hello
> │c│c│c│c│c│c│c│c│c│c│c│c..
> munmap(0x40017000, 5664) = 0
> getuid32() = 0
> getgid32() = 0
> setgid32(0) = 0
> setuid32(0) = 0
> read(0, "Hello World!", 8192) = 12
> write(1, "Hello World!", 12Hello World!) = 12

you read "Hello World!" and you write "Hello World!" to the console

> read(0, "\376\377\377f\377\330\0000", 8192) = 8
> write(1, "\376\377\377f\377\330\0000", 8│║ f0) = 8

and here you read garbage from the input, so you write garbage out,
which probably confuses the heck out of your terminal for not being
correct UTF-8


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-02-23 09:27    [W:0.044 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site