I was going through the LFS error codes and noticed that a few values don't match my system:
| Error |
LFS |
errno from GCC arm-none-eabi |
| LFS_ERR_NOTEMPTY |
-39 |
90 |
| LFS_ERR_NAMETOOLONG |
-36 |
91 |
May I suggest defining the LFS_ERR_* values in terms of the errno values from errno.h? This way, the system would always match, and there'd be no reason to write a custom mapping function that maps from LFS_ERR_* to system errno values.
Then, I could take all return values, check them for being negative, and setting errno to the negative of that value without a map.
littlefs/lfs.h
Line 70 in adad0fb
I was going through the LFS error codes and noticed that a few values don't match my system:
May I suggest defining the LFS_ERR_* values in terms of the errno values from errno.h? This way, the system would always match, and there'd be no reason to write a custom mapping function that maps from LFS_ERR_* to system errno values.
Then, I could take all return values, check them for being negative, and setting errno to the negative of that value without a map.