On Sat, Jul 09, 2011 at 02:20:46PM +0100, Daniel Drake wrote: > evstate is a small utility that queries evdev state of a specific > key, switch, button, LED or sound event. This is useful in programs > such as powerd (http://wiki.laptop.org/go/Powerd) which need to query > things like the state of the laptop lid switch from shell code. > > Our earlier non-upstream approach to this was to add sysfs nodes that > would indicate button state, but Dmitry Torokhov is against seeing those > in the upstream kernel as it is duplicating info from the input layer: Sounds too crazy... The duplication is normal (see for example block devices). There is many places where we have the same information accessible by ioctl() as well as by sysfs. The sysfs is usually the preferred way, because it does not require root permissions to read the attributes and you can use standard file/text utils rather than any specialized ioctl wrappers. > http://article.gmane.org/gmane.linux.drivers.platform.x86.devel/1089 Wow, so you have already implemented a patch that exports the state in *human readable format* by sysfs. This patch was NACKed. Now it's expected that everyone in userspace will use ioctl() (with root permissions?) and translate any crazy bit array to something human readable. Right? Really? Karel -- Karel Zak <kzak@xxxxxxxxxx> http://karelzak.blogspot.com -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html