include/nutt: Fix definitions used to access OS functions within the libraries. In the FLAT build, we must always set the errno and/or create cancellation points because the same library functions are used within the OS as are used by applications. This could cause issues for the OS but corrects some problems at the user interface.
Noted by Federico Braghiroli in Bitbucket issue 121.
This commit is contained in:
parent
71eac2d530
commit
3b1cc69d68
@ -73,16 +73,21 @@
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* The interfaces open(), close(), creat(), read(), pread(), write(),
|
||||
* pwrite(), poll(), select(), fcntl(), and aio_suspend() are all
|
||||
* cancellation points.
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*
|
||||
* The interfaces close(), creat(), read(), pread(), write(), pwrite(),
|
||||
* poll(), select(), fcntl(), and aio_suspend() are all cancellation
|
||||
* points.
|
||||
*
|
||||
* REVISIT: These cancellation points are an issue and may cause
|
||||
* violations: It use of these internally will cause the calling function
|
||||
* to become a cancellation points!
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# ifdef CONFIG_CPP_HAVE_VARARGS
|
||||
# define _NX_OPEN(p,f,...) nx_open(p,f,##__VA_ARGS__)
|
||||
# else
|
||||
|
@ -68,15 +68,13 @@
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* The interfaces sigtimedwait(), sigwait(), sigwaitinfo(), sleep(),
|
||||
* nanosleep(), and usleep() are cancellation points.
|
||||
*
|
||||
* REVISIT: The fact that these interfaces are cancellation points is an
|
||||
* issue and may cause violations: It use of these internally will cause
|
||||
* the calling function to become a cancellation points!
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# define _MQ_SEND(d,m,l,p) nxmq_send(d,m,l,p)
|
||||
# define _MQ_TIMEDSEND(d,m,l,p,t) nxmq_timedsend(d,m,l,p,t)
|
||||
# define _MQ_RECEIVE(d,m,l,p) nxmq_receive(d,m,l,p)
|
||||
|
@ -65,6 +65,11 @@
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*
|
||||
* The interfaces accept(), read(), recv(), recvfrom(), write(), send(),
|
||||
* sendto() are all cancellation points.
|
||||
*
|
||||
@ -73,7 +78,7 @@
|
||||
* to become a cancellation points!
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# define _NX_SEND(s,b,l,f) nx_send(s,b,l,f)
|
||||
# define _NX_RECV(s,b,l,f) nx_recv(s,b,l,f)
|
||||
# define _NX_RECVFROM(s,b,l,f,a,n) nx_recvfrom(s,b,l,f,a,n)
|
||||
|
@ -188,9 +188,14 @@
|
||||
* used both by the OS (libkc.a and libknx.a) or by the applications
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# define _SCHED_GETPARAM(t,p) nxsched_getparam(t,p)
|
||||
# define _SCHED_SETPARAM(t,p) nxsched_setparam(t,p)
|
||||
# define _SCHED_GETSCHEDULER(t) nxsched_getscheduler(t)
|
||||
|
@ -68,14 +68,13 @@
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* The interfaces sem_wait() and sem_timedwait() are cancellation points.
|
||||
*
|
||||
* REVISIT: The fact that sem_wait() and sem_timedwait() are cancellation
|
||||
* points is an issue and may cause violations: It use of these internally
|
||||
* will cause the calling function to become a cancellation points!
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# define _SEM_INIT(s,p,c) nxsem_init(s,p,c)
|
||||
# define _SEM_DESTROY(s) nxsem_destroy(s)
|
||||
# define _SEM_WAIT(s) nxsem_wait(s)
|
||||
|
@ -61,6 +61,11 @@
|
||||
* (libuc.a and libunx.a). The that case, the correct interface must be
|
||||
* used for the build context.
|
||||
*
|
||||
* REVISIT: In the flat build, the same functions must be used both by
|
||||
* the OS and by applications. We have to use the normal user functions
|
||||
* in this case or we will fail to set the errno or fail to create the
|
||||
* cancellation point.
|
||||
*
|
||||
* The interfaces sigtimedwait(), sigwait(), sigwaitinfo(), sleep(),
|
||||
* nanosleep(), and usleep() are cancellation points.
|
||||
*
|
||||
@ -69,7 +74,7 @@
|
||||
* the calling function to become a cancellation points!
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
|
||||
# define _SIG_PROCMASK(h,s,o) nxsig_procmask(h,s,o)
|
||||
# define _SIG_SIGACTION(s,a,o) nxsig_action(s,a,o,false)
|
||||
# define _SIG_QUEUE(p,s,v) nxsig_queue(p,s,v)
|
||||
|
Loading…
Reference in New Issue
Block a user