[haiku-bugs] Re: [Haiku] #7279: ioctl FIONREAD should set errno to ENOTTY for non supported file descriptors

  • From: "korli" <trac@xxxxxxxxxxxx>
  • Date: Fri, 25 Feb 2011 11:09:29 -0000

#7279: ioctl FIONREAD should set errno to ENOTTY for non supported file
descriptors
----------------------+-----------------------
   Reporter:  korli   |      Owner:  nobody
       Type:  bug     |     Status:  new
   Priority:  normal  |  Milestone:  R1
  Component:  System  |    Version:  R1/alpha2
 Resolution:          |   Keywords:
 Blocked By:          |   Blocking:
Has a Patch:  0       |   Platform:  All
----------------------+-----------------------

Comment (by korli):

 I would add a check for FIONREAD op in
 src/system/kernel/fs/fd.cpp:fd_ioctl()
 For FDTYPE_FILE, FDTYPE_DIR, FDTYPE_ATTR_DIR, FDTYPE_ATTR values of
 descriptor->type, it would return ENOTTY. There is no B_* error mapped to
 ENOTTY at the moment.

 I'm wondering why it returns B_NOT_SUPPORTED (EOPNOTSUPP) instead of
 ENOTTY which is recommended by the
 [http://pubs.opengroup.org/onlinepubs/009695399/functions/ioctl.html
 spec].

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7279#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: