bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getline in /proc


From: Simon Vaillancourt
Subject: Re: getline in /proc
Date: Fri, 16 Sep 2005 15:11:37 -0400
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Just wanted to add that version 3.1.5 also has that problem.

Simon Vaillancourt wrote:

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







reply via email to

[Prev in Thread] Current Thread [Next in Thread]