mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
To: Emmanuel Colbus <ecolbus@manux.info>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC][4/11][MANUX] Kernel compatibility : ioctl(2)
Date: Tue, 15 Apr 2014 16:00:35 +0100	[thread overview]
Message-ID: <20140415160035.3135dda7@alan.etchedpixels.co.uk> (raw)
In-Reply-To: <534D375E.7070308@manux.info>

On Tue, 15 Apr 2014 15:42:54 +0200
Emmanuel Colbus <ecolbus@manux.info> wrote:

> Continuing with syscalls, I would like to indicate you a modification
> I've done with regards to ioctl's. The thing is, I have had the need for
> ioctl's that return *file descriptors*, instead of standard return codes.

You probably only think you have ;-)

The return from an ioctl on 32bit is going to be an unsigned 32bit value,
as is a Linux file handle. So if you do

	fd = ioctl(foo);

then not only have you got an interface that isn't compliant with
POSIX/SuS you also have no error reporting capability.

The expectation of ioctl is

	err = ioctl(fd, FDIOWIBBLE, &result);

now if result is a pointer to where to store one or more file handles you
are sorted.

If you are going to use SuS/POSIX naming I'd really suggest sticking to
the expected behaviour in the standards.

Alan

  reply	other threads:[~2014-04-15 15:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-15 13:42 Emmanuel Colbus
2014-04-15 15:00 ` One Thousand Gnomes [this message]
2014-04-15 16:00   ` Emmanuel Colbus
2014-04-15 16:05     ` One Thousand Gnomes
2014-04-15 16:32       ` Emmanuel Colbus

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=20140415160035.3135dda7@alan.etchedpixels.co.uk \
    --to=gnomes@lxorguk.ukuu.org.uk \
    --cc=ecolbus@manux.info \
    --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

Powered by JetHome