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

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


#4505: posix_devctl() should return the errno directly not -1 and set errno
----------------------------+--------------------
  Reporter:  Joel Sherrill  |      Owner:  (none)
      Type:  defect         |     Status:  new
  Priority:  normal         |  Milestone:  5.2
 Component:  posix          |    Version:  5
  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/4505>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list