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

RTEMS trac trac at rtems.org
Sat Aug 21 19:25:36 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         |  Resolution:
 Keywords:                 |  Blocked By:
 Blocking:                 |
---------------------------+---------------------
Description changed by Joel Sherrill:

Old description:

> 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.

New description:

 The RTEMS implementation of 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#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list