[linux-pm] [PATCH 1/1] Add /sys/power/last_state support

Pavel Machek pavel at ucw.cz
Tue Jan 5 23:01:07 PST 2010


On Tue 2009-12-15 09:19:45, Stefan Seyfried wrote:
> On Mon, 7 Dec 2009 18:17:36 -0600
> Victor Lowther <victor.lowther at gmail.com> wrote:
> > On Dec 7, 2009, at 3:41 PM, "Rafael J. Wysocki" <rjw at sisk.pl> wrote:
> > > Can't you just use the error code returned by "echo mem > /sys/power/ 
> > > state"?
> > 
> > I can, now that I know about it - I did not see anything about error  
> > codes when scanning the documentation.
> 
> Note that "echo" only will return 0 or 1, not a real error code. You'll
> need a 5-line C program to get the errno that's returned from the
> kernel.
> It might be interesting to know *why* it failed (e.g. no swap
> partition or not enough space in there).

...and if the error codes are not unique enough, I guess we can just
improve them.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


More information about the linux-pm mailing list