Messages in this thread |  | | From | "Rafael J. Wysocki" <> | | Subject | Re: [PATCH 2/8] PM: suspend_block: Add driver to access suspend blockers from user-space | | Date | Mon, 3 May 2010 17:03:11 +0200 |
| |
On Sunday 02 May 2010, Alan Stern wrote: > On Sun, 2 May 2010, Rafael J. Wysocki wrote: > > > Hmm. It doesn't seem to be possible to create two different suspend blockers > > using the same file handle. So, what exactly is a process supposed to do to > > use two suspend blockers at the same time? > > Open the file twice, thereby obtaining two file handles.
Well, that's what I thought.
I must admit I'm not really comfortable with this interface. IMO it would be better if _open() created the suspend blocker giving it a name based on the name of the process that called it. Something like "<process name>_<timestamp>" might work at first sight.
Alternatively, "<process_name><number>", where <number> is 0 for the first suspend blocker created by the given process, 1 for the second one etc., also seems to be doable.
Rafael
|  |