[RTEMS Project] #4506: posix_devctl() should return the errno directly not -1 and set errno

RTEMS trac trac at rtems.org
Fri Aug 20 19:24:23 UTC 2021


#4506: posix_devctl() should return the errno directly not -1 and set errno
----------------------------+--------------------
  Reporter:  Joel Sherrill  |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:  6.1
 Component:  posix          |    Version:  6
  Severity:  normal         |   Keywords:
Blocked By:                 |   Blocking:
----------------------------+--------------------
 The RTEMS implementation posix_devctl() from POSIX 1003.26 does not return
 error codes as required by the standard.

     "Upon successful completion, posix_devctl() shall return zero;
 otherwise an error number shall be returned to indicate the error. The
 value returned via the dev_info_ptr argument is driver dependent."

 It should return the errno value and not -1 and set the errno variable.
 The current behavior is wrong but understandable because the
 implementation is a wrapper for close() and ioctl() which do set errno and
 return -1.

--
Ticket URL: <http://devel.rtems.org/ticket/4506>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list