LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* cat reading problem
@ 2007-02-23 8:06 Mockern
2007-02-23 8:24 ` Arjan van de Ven
0 siblings, 1 reply; 2+ messages in thread
From: Mockern @ 2007-02-23 8:06 UTC (permalink / raw)
To: linux-kernel
Hello,
I tried to cat < /dev/mytty/ttyS3, but cat shows nothing. I attached here strace
cat < /dev/mytty/ttyS3 and cat < hello. Hello is just a file. As you can see the
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
read(0, "", 8192) = 0
io_submit(0, 0x40200164, 0 <unfinished ... exit status 0>
Process 1520 detached
root@test:/home# strace cat < /dev/mytty/ttyS3
│c│c│c│c│c│c│c│c│c│c│c│c│c.
getuid32() = 0
getgid32() = 0
setgid32(0) = 0
setuid32(0) = 0
read(0, "\376\377\377f\377\330\0000", 8192) = 8
write(1, "\376\377\377f\377\330\0000", 8│║ f0) = 8
read(0, "", 8192) = 0
io_submit(0, 0x40200164, 0 <unfinished ... exit status 0>
Process 1522 detached
root@test:/home#
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: cat reading problem
2007-02-23 8:06 cat reading problem Mockern
@ 2007-02-23 8:24 ` Arjan van de Ven
0 siblings, 0 replies; 2+ messages in thread
From: Arjan van de Ven @ 2007-02-23 8:24 UTC (permalink / raw)
To: Mockern; +Cc: linux-kernel
> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-02-23 8:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-23 8:06 cat reading problem Mockern
2007-02-23 8:24 ` Arjan van de Ven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).