From: Gerd Hoffmann Subject: Re: [RFC] [PATCH] sysfs support for Xen attributes Date: Thu, 12 Jan 2006 15:42:20 +0100 Message-ID: <43C66ACC.60408@suse.de> References: <43C53DA0.60704@us.ibm.com> <20060111230704.GA32558@kroah.com> <43C5A199.1080708@us.ibm.com> <20060112005710.GA2936@kroah.com> <43C5B59C.8050908@us.ibm.com> <43C65196.8040402@suse.de> <1137072089.2936.29.camel@laptopd505.fenrus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1137072089.2936.29.camel@laptopd505.fenrus.org> Sender: linux-kernel-owner@vger.kernel.org To: Arjan van de Ven Cc: "Mike D. Day" , Greg KH , lkml , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Arjan van de Ven wrote: >> privcmd returns a filehandle which is then used >> for ioctls (misc char dev maybe?). > > > EWWWWWWWWWWWWWW > > what is wrong with open() ????? > things that return fd's that aren't open() (or dup and socket) are just > evil. Esp if it's in proc or sysfs. Nothing is wrong with open, but probably the sentense above is a bit too short. If you call fd = open("/proc/xen/privcmd", ...) you'll get a filehandle returned for the thingy (as usual) and then you'll use that filehandle to call ioctl(fd, ...), so it's the usual unix way ... cheers, Gerd -- Gerd 'just married' Hoffmann I'm the hacker formerly known as Gerd Knorr.