From: Pascal T. <pt...@li...> - 2007-01-05 00:41:52
|
Le vendredi 05 janvier 2007 à 01:16 +0100, Pascal Terjan a écrit : > Le jeudi 04 janvier 2007 à 19:24 +0100, Detlef Reichl a écrit : > > > I've attached 3 tests, 2 for the sysfs and one for the procfs. In the > > sysfs it hangs and with proc it runs. > > The 3 tests work fine here (i686, kernel 2.6.19.1, ruby 1.8.5, rg2 > 0.16.0) OK, it hangs on my other machine (x86_64, kernel 2.6.17, ruby 1.8.5, rg2 0.16.0) strace ruby -e 'File.new("/sys/class/tty/tty/dev", "r").gets' gives open("/sys/class/tty/tty/dev", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2ad4de2d3000 read(3, "5:0\n", 4096) = 4 strace ruby -rglib2 -e 'File.new("/sys/class/tty/tty/dev", "r").gets' gives open("/sys/class/tty/tty/dev", O_RDONLY) = 5 select(6, [3 5], [], [], NULL So, it looks like the threading issue I used to have on /proc but it looks line /proc/cmdline now handles correctly select. I guess now sysfs handles select while it did not in previous kernels. |