Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753598Ab0LGLTX (ORCPT ); Tue, 7 Dec 2010 06:19:23 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:46546 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154Ab0LGLTV (ORCPT ); Tue, 7 Dec 2010 06:19:21 -0500 MIME-Version: 1.0 In-Reply-To: <20101207105620.GB23729@core.coreip.homeip.net> References: <1291706726-8835-1-git-send-email-rydberg@euromail.se> <20101207091653.GA22416@core.coreip.homeip.net> <20101207105620.GB23729@core.coreip.homeip.net> From: Kay Sievers Date: Tue, 7 Dec 2010 12:19:05 +0100 Message-ID: Subject: Re: [RFC][PATCH] input: Introduce device information ioctl To: Dmitry Torokhov Cc: Henrik Rydberg , Jiri Kosina , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Ping Cheng , Chris Bagwell Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 946 Lines: 21 On Tue, Dec 7, 2010 at 11:56, Dmitry Torokhov wrote: > On Tue, Dec 07, 2010 at 11:48:28AM +0100, Kay Sievers wrote: >> Please don't add new ioctls which are not extensible. The ioctl should >> carry the length or the version of the structure it asks for, so it >> can be extended in the future. > > Size of ioctl data is encoded in ioctl, it can be extended easily. For > examples take a look at how EVIOCGKEYCODE and EVIOCGSKEYCODE are handled > in recent kernels. Oh, how does that work? With the ioctl call, userspace has to supply the size it expects to be returned from the kernel. How does the kernel otherwise know how much it is allowed to copy to the user? Kay -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/