"cat /proc/20502/wchan" vs strace vs man page

Previous thread: [PATCH] include/linux/mutex.h: unclear reference to convention by Matti Linnanvuori on Monday, September 24, 2007 - 3:38 am. (2 messages)

Next thread: What's in mmc.git for 2.6.24 by Pierre Ossman on Monday, September 24, 2007 - 4:28 am. (3 messages)
To: <linux-kernel@...>
Date: Monday, September 24, 2007 - 3:54 am

Try this:
1. At one prompt, do "cat".
Now, switch to another prompt and...
2. Do "pstree -p|grep cat" to find out the PID of your cat command. I
get 20502.
3. Do "cat /proc/20502/wchan". I get "0" here.
4. Do "strace -p 20502". I get "read(0, <unfinished ...>" here.

So wchan says cat is waiting for "0". Strace says cat is waiting for
read (which sounds much more probable to me).

Is "0" the correct contents of /proc/20502/wchan? I expected it to
say something about "read".

According to "man proc", wchan "is the "channel" in which the process
is waiting. It is the address of a system call". "0" doesn't seem to
fit that description. Is "0" or the man page wrong?

I'm on Ubuntu 7.04 Feisty, i686, have manpages "2.39-1", kernel "Linux
version 2.6.20-16-generic (root@terranova) (gcc version 4.1.2 (Ubuntu
4.1.2-0ubuntu4)) #2 SMP Fri Aug 31 00:55:27 UTC 2007".

I'm not subscribed to the list, please CC me on replies.

Cheers //Johan
-

Previous thread: [PATCH] include/linux/mutex.h: unclear reference to convention by Matti Linnanvuori on Monday, September 24, 2007 - 3:38 am. (2 messages)

Next thread: What's in mmc.git for 2.6.24 by Pierre Ossman on Monday, September 24, 2007 - 4:28 am. (3 messages)