mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Abramo Bagnara <abramo.bagnara@libero.it>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linus Torvalds <torvalds@transmeta.com>,
	Davide Libenzi <davidel@xmailserver.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Synchronous signal delivery..
Date: Sun, 16 Feb 2003 15:52:12 +0100	[thread overview]
Message-ID: <20030216155212.E21727@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <3E4E8013.C26DFA0@libero.it>; from abramo.bagnara@libero.it on Sat, Feb 15, 2003 at 06:59:47PM +0100

Hi there,

On Sat, Feb 15, 2003 at 06:59:47PM +0100, Abramo Bagnara wrote:
> We might call this thread "the neverending misunderstanding" ;-)
 
;-)

> My message was a proposal about an universal solution for
> control/out-of-band streams on pseudo-files (like the Linus sig fd,
> devices fd, socket, proc files, etc.) as a way to comunicate between
> user space and kernel space.
> 
> I.e. something that might replace ioctl/fcntl mess giving same (and
> more) flexybility and power (extending the 'everything is a file'
> concept also to control data).
> 
> This is *not* something I'd propose for user space (where we definitely
> have many good ways to achieve these results).

So you propose channels that are defined ONLY by the kernel? That
would make much more sense and could replace ioctl/fcntl indeed,
if we add one more syscall: sys_transact().

long transact(int fd, const void *request_buffer, const size_t request_size,
                      void *result_buffer, const size_t result_size);

This syscall works like read/write with some exceptions:
   
   (Basis features)
   - short reads/short writes are not allowed
   - EINTR will not happen.
   - the effects done to the fd and the underlying object must be
     undone if the request will fail
   - it is optional (file operation) and can return -1/errno=ENOSYS, 
     if not implemented by the underlying kernel object.
   - supplying (fd, NULL, 0, NULL, 0) checks for existence (NOP).

   (Advanced features)
   - supplying (fd, REQUEST, sizeof(REQUEST), MAP_FAILED, 0) 
     returns the expected return buffer size for this request (or
     zero, if no result will be returned). May return -ENXIO, if
     this checking is not supported or -EINVAL, if that request
     is not supported by the underlying kernel object.

   - supplying (fd, REQUEST, sizeof(REQUEST), NULL, 0)
     is issueing a request without a result (e.g. a COMMAND) or
     telling that the user is not interested in any detailed
     results (that variant might be supported by the kernel object or not)

   - The two buffers might alias partially or as a whole.

With that additional semantic we could replace all ioctl() too,
where an ioctl() is used only to get this semantic.

Other OSes have an ioctl() mechanism like that syscall and we
implement it by destroying the argument in IORW-ioctls.

With that in place, I could live without ioctl() and fcntl().
That would also destroy all the interfaces that require you to
read after a write, because it needs transaction semantics 
(sg.c comes to mind).

Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth

  reply	other threads:[~2003-02-16 14:42 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-13 19:46 Linus Torvalds
2003-02-13 20:22 ` Davide Libenzi
2003-02-13 20:25   ` Linus Torvalds
2003-02-13 22:26     ` Davide Libenzi
2003-02-13 22:54       ` Linus Torvalds
2003-02-14  8:55         ` Abramo Bagnara
2003-02-14 14:24           ` Alan Cox
2003-02-14 13:57             ` Abramo Bagnara
2003-02-15 12:36               ` Ingo Oeser
2003-02-15 17:59                 ` Abramo Bagnara
2003-02-16 14:52                   ` Ingo Oeser [this message]
2003-02-15  0:00         ` Davide Libenzi
2003-02-15  0:06           ` Matti Aarnio
2003-02-15  1:08             ` Linus Torvalds
2003-02-15  1:30               ` Jeff Garzik
2003-02-15  1:23             ` Davide Libenzi
2003-02-15  1:03           ` Linus Torvalds
2003-02-15  2:09             ` Davide Libenzi
2003-02-15 20:08               ` Linus Torvalds
2003-02-15 23:39                 ` Davide Libenzi
2003-02-17  2:28                 ` Jan Harkes
2003-02-15  5:04             ` Keith Adamson
2003-02-15 19:19           ` James Antill
2003-02-15 22:31             ` Davide Libenzi
2003-02-17 23:34               ` James Antill
2003-02-17 15:26           ` Daniel Heater
2003-02-15  4:08   ` Werner Almesberger
2003-02-15 22:00     ` Davide Libenzi
2003-02-16  0:18       ` Werner Almesberger
2003-02-17  4:46     ` Jamie Lokier
2003-02-13 20:45 ` Paul P Komkoff Jr
2003-02-13 21:25   ` Richard B. Johnson
2003-03-27 21:40   ` watching for file creation completion [was Re: Synchronous signal delivery..] Alexander Kellett
2003-02-14  2:40 ` Synchronous signal delivery Jamie Lokier
2003-02-14  3:11   ` Keith Adamson
2003-02-14  3:54     ` Keith Adamson
2003-02-15  0:04   ` Davide Libenzi
2003-02-15  1:01     ` Jamie Lokier
2003-02-15  1:12       ` Randy.Dunlap
2003-02-15  1:50       ` Davide Libenzi
2003-02-15  2:08         ` Jamie Lokier
2003-02-15  4:09           ` Davide Libenzi
2003-02-15  4:34             ` Jamie Lokier
2003-02-14 10:55 ` Giuliano Pochini
2003-02-14 13:04   ` Keith Adamson
2003-02-15  4:25   ` Werner Almesberger
2003-02-15  5:14     ` Werner Almesberger
2003-02-14  7:09 Dan Kegel

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=20030216155212.E21727@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=abramo.bagnara@libero.it \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®