RT-Thread / rt-thread

RT-Thread is an open source IoT Real-Time Operating System (RTOS).
https://www.rt-thread.io
Apache License 2.0
10.27k stars 4.96k forks source link

错误码设定和返回规范 | Error code setting and return specification #7950

Open mysterywolf opened 1 year ago

mysterywolf commented 1 year ago

1 RT-Thread 有两种错误码

若代码、组件是针对POSIX兼容设计的,则使用POSIX标准错误码,否则使用RT-Thread错误码。

例如:AT组件不是POSIX兼容设计,因此使用RT-Thread错误码;DFSv2是POSIX兼容设计,因此采用POSIX错误码。

2 错误码的正负

3 相关

https://github.com/RT-Thread/rt-thread/issues/4791


1 RT-Thread has two error codes

If the code and component are designed for POSIX compatibility, use the POSIX standard error code, otherwise use the RT-Thread error code.

For example: AT components are not POSIX compliant, so RT-Thread error codes are used; DFSv2 is POSIX compliant, so POSIX error codes are used.

2 The sign of the error code

BernardXiong commented 1 year ago

若代码、组件是针对POSIX兼容设计的,

这个时候RT的错误码会被定义成POSIX的标准错误码

mysterywolf commented 1 year ago

当POSIX打开之后,rt-thread错误码兼容POSIX错误码