You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/02 14:22:40 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on pull request #226: apps: Change all "set_errno(xxx);" to "errno = xxx;"

xiaoxiang781216 commented on pull request #226:
URL: https://github.com/apache/incubator-nuttx-apps/pull/226#issuecomment-622961165


   > Have you tried this in protected and/or kernel build modes. There might be probablys write to the errno in those cases since the errno resides in the TCB which is not accessible. In those modes set_errno() is a function call that goes through a syscall and error is defined to be get_errno() which will only support read access.
   > 
   
   Yes, you are right. userspace can't access TCB directly in protected/kernel build.
   
   > So reading the errno in the modes is okay, but writing must explicitly use set_errno(). That does break the standard but I am open to other technical solutions.
   
   What I can imagine:
   1.Move errno to userspace(e.g. at the begining of thread stack)
   2.Overwrite assignment operatior(but require C++)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org