On Feb 26, 2018 5:13 AM, "Jakob Viketoft" <jakob.viket...@aacmicrotec.com> wrote:
Hello! We have a number of drivers in our BSP which all use the POSIX access methods to try and keep a clean interface etc. However, we also seem to stumble into a return error code translation issue. RTEMS seems to have a very few defined errno's and translate the relatively scarce amount of RTEMS error codes into an even sparser selection of errno codes. We would like our drivers to be a bit communicative when encountering an error and the available error codes are very few due to the translation happening. Is there some way of forwarding a wider variety of errno numbers? E.g. could it be possible for the translation mechanism to look if there is already an errno defined and then return this instead of doing the error code translation? It seems like the translation I'm talking about happens in the rtems_deviceio_write() function in cpukit/libcsupport/src/sup_fs_deviceio.c Are we doing it wrong or could there be some amendments to allow for bigger freedom here? All suggestions are appreciated. Completely random thought as I sit on a plane without code. Add a field to the arguments structure for errno. See it to zero before the call. If it is set to non-zero after the call, then the driver wanted to return errno directly. Otherwise translate. A middle step is to see if any of the unused RTEMS status codes make sense to use and cover your use cases. We're currently running 4.11, but will probably move up to 5 soonish. /Jakob _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel
_______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel