lkml.org 
[lkml]   [2010]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-pm] [PATCH 2/9] PM: suspend_block: Add driver to access suspend blockers from user-space
On Fri, 23 Apr 2010, Pavel Machek wrote:

> Hi!
>
> > Add a misc device, "suspend_blocker", that allows user-space processes
> > to block auto suspend. The device has ioctls to create a suspend_blocker,
> > and to block and unblock suspend. To delete the suspend_blocker, close
> > the device.
> >
> > Signed-off-by: Arve Hj??nnev??g <arve@android.com>
>
> > --- a/Documentation/power/suspend-blockers.txt
> > +++ b/Documentation/power/suspend-blockers.txt
> > @@ -95,3 +95,20 @@ if (list_empty(&state->pending_work))
> > else
> > suspend_block(&state->suspend_blocker);
> >
> > +User-space API
> > +==============
> > +
> > +To create a suspend_blocker from user-space, open the suspend_blocker device:
> > + fd = open("/dev/suspend_blocker", O_RDWR | O_CLOEXEC);
> > +then call:
> > + ioctl(fd, SUSPEND_BLOCKER_IOCTL_INIT(strlen(name)), name);
>
>
> This seems like very wrong idea -- it uses different ioctl number for
> each length AFAICT.

How about specifying the name by an ordinary write() call instead of
by an ioctl()?

Alan Stern



\
 
 \ /
  Last update: 2010-04-23 18:47    [W:0.189 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site