From: Pjotr Kourzanov <peter.kourzanov@xs4all.nl>
To: LKML <linux-kernel@vger.kernel.org>
Subject: Re: ioctl assignment strategy?
Date: Mon, 20 Dec 2004 23:48:42 +0100 [thread overview]
Message-ID: <41C756CA.5080504@xs4all.nl> (raw)
In-Reply-To: <41C70DF2.80101@nortelnetworks.com>
Chris Friesen wrote:
> Greg KH wrote:
>
>> Rethink the way you want to control your device. Seriously, a lot of
>> ioctls can be broken down into single device files, single sysfs files,
>> or other such things (a whole new fs as a last resort too.)
>
>
> Actually, my particular case is likely not a good example. We've got a
> misc char driver giving access to a lot of miscellaneous features we've
> added to the kernel,. We originally (a few years back) used new
> syscalls, but then we started supporting a bunch more arches, and having
> to patch all of them just to add syscall numbers sucked.
>
> Some of it could easily be moved to /proc or /sys, but if you do it that
> way, how do you handle returning unusual error values? Other stuff
> involves multiple stages of registration, then getting handles returned,
> and doing new calls with those handles. I don't see how this would tie
> nicely into the read/write paradigm.
/That/ is exactly what FS API is good for: returning error values is
done via read(/sys/mystuff/errno,&err,4), getting handles is done via
open(/sys/mystuff/mycomp) and doing new calls is just calling FS API
with the *file* handle. Registration, depending on your definition of it
can be viewed as a link(/sys/mystuff/object,/sys/mystuff/subsystem) or
as a write(/sys/mystuff/subsystem/registered,"object"). Take a peek into
Plan9 from Bell Labs for inspiration...
>
> What's the big problem with ioctls anyways? I mean, in a closed
> environment where I'm writing both the userspace and the kernelspace
> side of things.
>
> Chris
> -
> 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/
>
next prev parent reply other threads:[~2004-12-20 22:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-14 23:31 ioctl assignment strategy? Al Hooton
2004-12-15 0:46 ` Greg KH
2004-12-15 14:53 ` Chris Friesen
2004-12-17 23:48 ` Greg KH
2004-12-20 17:37 ` Chris Friesen
2004-12-20 22:48 ` Pjotr Kourzanov [this message]
2004-12-21 0:32 ` Alan Cox
2004-12-21 2:06 ` Lee Revell
2004-12-21 12:51 ` Olivier Galibert
2004-12-21 17:24 ` Greg KH
2004-12-22 17:16 ` Al Hooton
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=41C756CA.5080504@xs4all.nl \
--to=peter.kourzanov@xs4all.nl \
--cc=linux-kernel@vger.kernel.org \
/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