[lkml]   [2007]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject"cat /proc/20502/wchan" vs strace vs man page
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
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-09-24 09:57    [W:0.043 / U:3.960 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site