tmedicci opened a new pull request, #8985:
URL: https://github.com/apache/nuttx/pull/8985

   ## Summary
   
   Nowadays, opening a FIFO for write-only (with `O_NONBLOCK` cleared) won't 
block even if there are no readers. Only opening for read-only (with no 
writers) would block. This is not a POSIX-compliant behavior. 
   
   According to 
https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
   
    > When opening a FIFO with O_RDONLY or O_WRONLY set:
    >  * If O_NONBLOCK is set, an open() for reading-only shall return without 
delay. An open() for writing-only shall return an error if no process currently 
has the file open for reading.
   >
   >  * If O_NONBLOCK is clear, an open() for reading-only shall block the 
calling thread until a thread opens the file for writing. An open() for 
writing-only shall block the calling thread until a thread opens the file for 
reading. 
   
   This commit has an equivalent on nuttx-apps: `EXAMPLES_PIPE` app was updated 
to check pipes and named pipes behavior.
   
   ## Impact
   
   It would be a _possible_ breaking change if any application was written 
specifically to expect an `open` for write-only (and `O_NONBLOCK` cleared, of 
course) to be non-blocking even if there are no readers. Being able to port 
POSIX-compliant applications that expect `open` to block when opening for 
write-only with no readers would enhance NuttX's objective of "to achieve a 
high degree of standards compliance. The primary governing standards are POSIX 
and ANSI standards". That is the case for [RTP 
Tools](https://github.com/apache/nuttx-apps/pull/1651), for instance.
   
   ## Testing
   
   `sim:citest`, running [`pipe` app]() and [RTP 
Tools](https://github.com/apache/nuttx-apps/pull/1651) on  ESP32-LyraT v4.1 
with `rtpdump`.
   


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

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

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

Reply via email to