From mboxrd@z Thu Jan 1 00:00:00 1970 From: tytso@mit.edu Subject: Re: [PATCH 2/9] PM: suspend_block: Add driver to access suspend blockers from user-space Date: Fri, 23 Apr 2010 21:53:34 -0400 Message-ID: <20100424015334.GO14986__5339.90181652388$1272075997$gmane$org@thunk.org> References: <1271984938-13920-1-git-send-email-arve@android.com> <1271984938-13920-2-git-send-email-arve@android.com> <1271984938-13920-3-git-send-email-arve@android.com> <20100423084349.GC1573@ucw.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20100423084349.GC1573@ucw.cz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Pavel Machek Cc: Len Brown , linux-doc@vger.kernel.org, Jesse Barnes , linux-kernel@vger.kernel.org, Magnus Damm , linux-pm@lists.linux-foundation.org List-Id: linux-pm@vger.kernel.org On Fri, Apr 23, 2010 at 10:43:49AM +0200, Pavel Machek wrote: > > +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. Yep, and there's nothing wrong with that IMHO. It's a clever use of the _IOC encoding scheme. - Ted