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/03/31 13:11:01 UTC

[GitHub] [incubator-nuttx] patacongo opened a new issue #669: Don't use nxsem_wait_interruptible in read()/write()

patacongo opened a new issue #669: Don't use nxsem_wait_interruptible in read()/write()
URL: https://github.com/apache/incubator-nuttx/issues/669
 
 
   In many places, nxsem_wait_uninterruptible() is used directly in directly in the read() or write() methods of character drivers.  POSIX, however, requires that these methods return EINTR if interrupted by a signal.
   
   For read(), EINTR should be returned to indicate "The read operation was terminated due to the receipt of a signal, and no data was transferred."  https://pubs.opengroup.org/onlinepubs/009695399/functions/read.html
   
   For write(), EINTR means that "The write operation was terminated due to the receipt of a signal, and no data was transferred." 
   
   POSIX also requires that the open() and close() method return EINTR if any signal is received (although I think supporting this in close() would cause issues since people seldom check the return value from close).
   
   More general, the read() and write() methods should return EINTR if a signal is received even if there is no underlying character driver.  This means that the block read/write methods of block and MTD drivers also must return EINTR if interrupt.
   

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


With regards,
Apache Git Services