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/11/20 16:33:26 UTC

[GitHub] [incubator-nuttx] patacongo edited a comment on pull request #2326: libc: Enhance getopt function

patacongo edited a comment on pull request #2326:
URL: https://github.com/apache/incubator-nuttx/pull/2326#issuecomment-731261177


   An issue with using TLS is that the variables would be duplicated for each thread.  That would be required for true thread safety, but in reality only one instance of the variables are needed per task group (just as there are only one instance of the getopt() variables per process under Linux).  That is because getopt() is normally only used from main() using the argc and argv inputs.
   
   An option would be to put the getopt() variables in struct task_tcb_s or, better, struct group_s.  But that would require a special system call which would be pretty ugly.


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