Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1087613
| From | Vincent Danjean <vdanjean@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.kernel |
| Subject | Bug#1002711: linux-image-5.14.0-4-amd64: poll syscall does not work on some /proc files |
| Date | 2021-12-30 19:30 +0100 |
| Message-ID | <DA8lz-7Wi-1@gated-at.bofh.it> (permalink) |
| References | <Dz6OS-34w-1@gated-at.bofh.it> <DA4hX-5xZ-1@gated-at.bofh.it> <Dz6OS-34w-1@gated-at.bofh.it> <DA4hX-5xZ-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
On 30/12/2021 14:52, Bastian Blank wrote:
> On Mon, Dec 27, 2021 at 11:31:21PM +0100, Vincent Danjean wrote:
>> On a plain (with more than two bytes) file, the second poll succeed.
>> On /proc/bus/input/devices, the second poll hangs.
>> Note: this is an old behavior. I initially observe it on an embeded system with
>> a 4.1 kernel.
>
> /proc is no real filesystem. It simply does not support poll, because
> the output is generated while you are reading it, so it does not know
> when anything changes. See also
> https://unix.stackexchange.com/questions/74713/how-frequently-is-the-proc-file-system-updated-on-linux?rq=1
>
> If you want to know about hardware changes, use udev or listen to kernel
> netlink messages.
I understand that /proc is different. But I'm not monitoring it.
My goal was only to read it totally from a busybox shell with a
"while read" loop to find the eventX associated with the
touchscreen of the e-reader.
And the first read from busybox shell never complete (instead of
returning the first line of the file) due to the fact that
busybox use poll, then read a byte, then use poll again.
Do you think I should reassign this bug to busybox?
Or do you think I'm wrong trying to read the /proc file
from a shell script without to copy it elsewhere before?
Stalling:
busybox sh -c 'while read l ; do echo $l ; done < /proc/bus/input/devices'
Working (but bash is not present on the initial target system):
bash -c 'while read l ; do echo $l ; done < /proc/bus/input/devices'
As workaround, I'm currently using a copy of the file
("busybox cp" works). It should probably also be possible
to get the same kind of info from /sys files but this seems
less easy.
I just saw that other files seems to work:
Ok:
busybox sh -c 'read l < /proc/bus/input/handlers ; echo $l'
Stale:
busybox sh -c 'read l < /proc/bus/input/devices ; echo $l'
Regards,
Vincent
>
> Bastian
>
Back to linux.debian.bugs.dist | Previous | Next — Previous in thread | Find similar | Unroll thread
Bug#1002711: linux-image-5.14.0-4-amd64: poll syscall does not work on some /proc files Vincent Danjean <vdanjean@debian.org> - 2021-12-27 23:40 +0100
Bug#1002711: linux-image-5.14.0-4-amd64: poll syscall does not work on some /proc files Bastian Blank <waldi@debian.org> - 2021-12-30 15:10 +0100
Bug#1002711: linux-image-5.14.0-4-amd64: poll syscall does not work on some /proc files Vincent Danjean <vdanjean@debian.org> - 2021-12-30 19:30 +0100
csiph-web