Skip to content

[ESP32] Errno mismatch between esp-idf and mpy #5752

@tve

Description

@tve

The esp32 port sets MICROPY_USE_INTERNAL_ERRNO which causes the built-in list of error codes in py/mperrno.h to be used. That's mostly OK, but there are discrepancies WRT esp-idf (see newlib's errno.h) and lots of missing error codes as a result. Examples:

  • MP uses 115 for EINPROGRESS while esp-idf uses 119, this particular one is patched up in exception_from_errno in https://github.com/micropython/micropython/blob/master/ports/esp32/modsocket.c#L156, however esp-idf uses 115 for ENETDOWN, which is now essentially undetectable
  • socket operations can return errno 23, which is not defined in MP's list, which means the user has to go on a hunt for where that may be defined to see that it's ENFILE /* Too many open files in system */ (happens, for example, if one doesn't close sockets on error somewhere).
  • there are many other useful socket errors which are not in MP's list

Q: is there a reason the esp32 port sets the insufficient MICROPY_USE_INTERNAL_ERRNO other than expediency at the time?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy