On Fri, 11 Mar 2005, Nigel Cunningham wrote: > Hi. > > On Fri, 2005-03-11 at 16:28, David Zeuthen wrote: > > Maybe I'm reading the source wrong, but isn't it the case that some > > laptops using APM (my IBM thinkpad T41 with acpi=off for instance) > > suspends without user space interaction when the lid is closed, thus > > rendering it impossible to send the event from user space? > > > > One may even ask whether it's sound to assume that all architectures > > will be suspended via user space? > > The most common way at the moment for a lid switch to activate > suspending is via the userspace acpid daemon. I'd be mildly interested > if you didn't have something equivalent running on your machine. APM doesn't work like that. There *might* be a way for the lid switch interrupt to be passed to the kernel, which can the forward it to userspace. But traditionally, the interrupt would generate an SMI and be handled by the BIOS in a manner completely transparent to the OS (using the Evil System Management Mode on x86 processor). While it is true that APM is obsolete, a similar method to suspend some systems may be employed by the system designer. I believe it's going to be common in embedded systems, where an external signal triggers a suspend transition. That doesn't preclude us from pushing the signal out to userpsace and requiring userspace to trigger the susped through sysfs, but my general opinion is that that solution is inelegant in principal and may not be fast enough for people employing it. Pat 5B