pkarashchenko commented on issue #1027:
URL: 
https://github.com/apache/incubator-nuttx/issues/1027#issuecomment-1155275788

   I expect that this proposal assumes that POSIX APIs are a system calls, 
however such approach introduce the implicit cancellation point support. For 
example the some of libc rely on `sem_wait` and that makes the users of 
`sem_wait` to become a cancellation points implicitly. That is not good. We 
need to have a system call layer that is agnostic to cancellation points and 
does not use `errno`. There are not much of such cases, so maybe having two 
variants of semaphore system call APIs may be a solution (like `nxsem_wait` and 
`nxsem_wait_cancellable()`) or making one more generic system call API in the 
middle like `nxsem_wait_proxy(FAR sem_t *sem, int oflags);` where `oflags` will 
be `CANCELABLE`, `BLOCK`, etc., so `nxsem_wait`, `nxsem_trywait`, `sem_wait` 
and `sem_trywait` can be implemented calling a proxy. I'm not sure what is the 
best strategy.


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