<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Feb 26, 2018 5:13 AM, "Jakob Viketoft" <<a href="mailto:jakob.viketoft@aacmicrotec.com">jakob.viketoft@aacmicrotec.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<br>
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.<br>
<br>
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?<br>
<br>
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?<br>
<br>
It seems like the translation I'm talking about happens in the rtems_deviceio_write() function in cpukit/libcsupport/src/sup_fs_<wbr>deviceio.c<br>
<br>
Are we doing it wrong or could there be some amendments to allow for bigger freedom here? All suggestions are appreciated.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">Completely random thought as I sit on a plane without code. </div><div dir="auto"><br></div><div dir="auto">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.</div><div dir="auto"><br></div><div dir="auto">A middle step is to see if any of the unused RTEMS status codes make sense to use and cover your use cases.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
We're currently running 4.11, but will probably move up to 5 soonish.<br>
<br>
        /Jakob<br>
______________________________<wbr>_________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/devel</a><br>
</blockquote></div><br></div></div></div>