[haiku-development] Re: mapping ENOTTY

  • From: Ingo Weinhold <ingo_weinhold@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 02 Mar 2011 11:27:23 +0100

On 2011-03-02 at 11:09:58 [+0100], Jérôme Duval <korli@xxxxxxxxxxxxxxxx> 
wrote:
> 2011/3/2 Ingo Weinhold <ingo_weinhold@xxxxxx>:
> >
> > On 2011-03-01 at 23:38:31 [+0100], Jérôme Duval <korli@xxxxxxxxxxxxxxxx>
> > wrote:
> >> I'd like to map ENOTTY to B_DEV_INVALID_IOCTL. It should help for
> >> http://dev.haiku-os.org/ticket/7279
> >> Any thoughts?
> >
> > They don't have much to do with each other. I didn't even notice there was
> > a B_DEV_INVALID_IOCTL. Obviously that's the error code to be returned
> > instead of B_BAD_VALUE or B_[NOT_,UN]SUPPORTED. Doing that consistently
> > would also allow to remap it to ENOTTY for the ioctls in question in a
> > central place.
> 
> That should be OK indeed. I changed a few file systems locally to
> return ENOTTY and that was OK for my tests.
> In your opinion, should the remapping occur in libroot or in the kernel?

In the kernel. That will also make the correct error codes appear in strace. 
and since ioctl() is also used in the kernel the code would just be 
duplicated anyway.

CU, Ingo

Other related posts: