errno
less than a minute
Porting Method
- Set Picolibc configuration
newlib-global-errnototrue, not using theTLSmechanism to implementerrno; - Set Picolibc configuration
errno-functionto'__errno'; - XWOS defines an
__errnovariable in each thread object structure and re-implements theint * __errno(void)function, returning the address of the current thread object’s__errno:
int * __errno(void)
{
xwos_thd_d thdd = xwos_cthd_self();
return &thdd.thd->osthd.libc.error_number;
}
- When using the
errnomacro from<errno.h>, the thread’s own__errnocan be obtained, no longer depending on libgloss.