public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Albert Cahalan <albert@users.sf.net>
To: linux-kernel mailing list <linux-kernel@vger.kernel.org>
Cc: arjanv@redhat.com, viro@parcelfarce.linux.theplanet.co.uk,
	mst@mellanox.co.il, filia@softhome.net
Subject: Re: f_ops flag to speed up compatible ioctls in linux kernel
Date: 01 Sep 2004 11:36:21 -0400	[thread overview]
Message-ID: <1094052981.431.7160.camel@cube> (raw)

Arjan van de Ven writes:
> On Wed, Sep 01, 2004 at 03:50:11AM -0600, filia@softhome.net wrote:

>> Stop being arrogant. Can you please elaborate on how
>> to make Linux kernel support e.g. motion controllers?
>> They do not fit *any* known to me driver interface.
>> They have several axes, they have about twenty
>> parameters (float or integer), and 
>
> parameters nicely fit in sysfs.

Per-command parameters included?

People really do want private syscalls. An ioctl
is that, in a namespace defined by the file
descriptor. So ioctl() provides local scope to
something that would otherwise be global.

The alternative is to add a zillion odd syscalls.

Life is messy.

>> they have several commands, a-la start, graceful stop,
>> abrupt stop. Plus obviously diagnostics - about ten
>> another commands with absolutely different parameters.
>> And about ten motion monitoring commands. And this is 
>> one example I were need to program. 
>
> a write() interface doesn't work???
> Hard to believe, you even call them commands.
> fd = open("/dev/funkydevice");
> write(fd, "start");
>
> doesn't sound insane to me

That's just a double-crufty ioctl in disguise.
See also: "the /proc filesystem"

It looks like encouragement of choices that will
tend toward the creation of buffer overflows in
the kernel. Nearly all buffer overflows involve
parsing ASCII. Sure, nobody should make mistakes...

People won't do that though. Know what you'll
get if ioctl isn't used? Here you go:

///////////////////////  Look ma, no ioctl!  /////
struct ctldata scd;
struct ctldata *scdp = &scd;

scd.command = GET_MOTOR_TEMPERATURE;
scd.arg[0] = MOTOR_Z;

// Arjan wants it this way.
// (for Viro, must print the pointer in decimal)
write(fd, &scdp, sizeof ctldata);

motor_temp.current = scd.ret[0];
motor_temp.peak    = scd.ret[1];
/////////////////////////////////////////////////



             reply	other threads:[~2004-09-01 15:43 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-01 15:36 Albert Cahalan [this message]
2004-09-01 15:59 ` f_ops flag to speed up compatible ioctls in linux kernel Roland Dreier
2004-09-01 21:53   ` Michael S. Tsirkin
2004-09-01 22:58     ` Roland Dreier
2004-09-01 23:18       ` Michael S. Tsirkin
  -- strict thread matches above, loose matches on Subject: below --
2004-12-27 22:22 Michael S. Tsirkin
2004-09-01 15:40 Albert Cahalan
2004-09-01 21:23 ` Michael S. Tsirkin
2004-09-01 21:38   ` Lee Revell
2004-09-01 21:43   ` Chris Wright
2004-09-01 21:44   ` Roland Dreier
2004-09-01  9:50 filia
2004-09-01  9:52 ` Arjan van de Ven
2004-09-01 10:16   ` filia
     [not found]     ` <4135B9FC.7050602@hist.no>
2004-09-01 13:29       ` Ihar 'Philips' Filipau
2004-09-01 15:28         ` Ihar 'Philips' Filipau
2004-09-02  7:29         ` Helge Hafting
2004-09-01 13:43     ` Olivier Galibert
2004-09-01  7:22 Michael S. Tsirkin
2004-09-01  7:32 ` viro
2004-09-01  7:44   ` Michael S. Tsirkin
2004-09-01  7:47   ` Lee Revell
2004-09-01  8:19     ` Michael S. Tsirkin
2004-09-01 15:55   ` Roland Dreier
2004-09-01 18:02     ` Chris Wright
2004-09-01 18:12       ` Roland Dreier
2004-09-01 18:31         ` viro
2004-09-01 20:54       ` Roland Dreier
     [not found]         ` <20040901170800.K1924@build.pdx.osdl.net>
     [not found]           ` <20040901190122.L1924@build.pdx.osdl.net>
2004-09-02  3:46             ` Roland Dreier
2004-09-01 18:06   ` Bill Davidsen
2004-09-01  8:30 ` Arjan van de Ven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1094052981.431.7160.camel@cube \
    --to=albert@users.sf.net \
    --cc=arjanv@redhat.com \
    --cc=filia@softhome.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@mellanox.co.il \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox