Description of problem: # uname -a Linux squad3.rhts.bos.redhat.com 2.6.9-78.0.13.EL #1 SMP Wed Jan 7 17:25:20 EST 2009 ppc64 ppc64 ppc64 GNU/Linux # cat rtas.c #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> int main (void) { int fd; char buf[4096]; fd = open ("/proc/ppc64/rtas/error_log", O_RDONLY | O_NONBLOCK); read (fd, buf, 4096); perror ("read"); return 0; } # gcc rtas.c -o rtas # ./rtas read: Invalid argument It looks like this only happen the first time. Next time running the reproducer (not matter reboot the machine or not, boot a different kernel or not), it will hang forever, which indicates the same bug in RHEL 5. Bug 376831 - Read from /proc/ppc64/rtas/error_log does not honor O_NONBLOCK Version-Release number of selected component (if applicable): kernel-2.6.9-78.0.13.EL kernel-2.6.9-78.EL How reproducible: always
Vitaly, you can see from comment #0, and also the LTP test from comment #1 were both using 4096 as the buffer size, so perhaps it is still not large enough?
You are correct. A bigger buffer like 40960 works fine. # ./rtas read: Success # ./rtas read: Resource temporarily unavailable # ./rtas read: Resource temporarily unavailable # ./rtas read: Resource temporarily unavailable So this should be closed as NOTABUG and send a patch to LTP instead. Thanks.