Simon Vaillancourt
2005-09-16 18:15:18 UTC
Hello,
I'm not sure if this is a gawk(using version 3.1.1) bug or a procfs
issue but but when doing a getline on a file that doesn't exist in
/proc, it loops forever, for example :
echo test | gawk 'BEGIN { while (getline <
"/proc/anypid/unexistingfile") {print "line="$0}}'
I stumbled on this while writing a process analysis tool, when a process
for which I am readins properties in /proc suddently dies, my script
goes crazy. I can work around this problem by copying the files in /tmp
before reading them.
Thanks
Simon
I'm not sure if this is a gawk(using version 3.1.1) bug or a procfs
issue but but when doing a getline on a file that doesn't exist in
/proc, it loops forever, for example :
echo test | gawk 'BEGIN { while (getline <
"/proc/anypid/unexistingfile") {print "line="$0}}'
I stumbled on this while writing a process analysis tool, when a process
for which I am readins properties in /proc suddently dies, my script
goes crazy. I can work around this problem by copying the files in /tmp
before reading them.
Thanks
Simon