aboutsummaryrefslogtreecommitdiff
path: root/py/mperrno.h
AgeCommit message (Collapse)Author
2021-06-24py/mperrno: Add MP_ECANCELED error code.David Lechner
This is useful when binding asynchronous functions in C. Signed-off-by: David Lechner <david@pybricks.com>
2018-05-01py/mperrno: Define MP_EWOULDBLOCK as EWOULDBLOCK, not EAGAIN.Damien George
Most modern systems have EWOULDBLOCK aliased to EAGAIN, ie they have the same value. But some systems use different values for these errnos and if a uPy port is using the system errno values (ie not the internal uPy values) then it's important to be able to distinguish EWOULDBLOCK from EAGAIN. Eg if a system call returned EWOULDBLOCK it must be possible to check for this return value, and this patch makes this now possible.
2017-07-24py/mperrno: Allow mperrno.h to be correctly included before other hdrs.Damien George
Before this patch the mperrno.h file could be included and would silently succeed with incorrect config settings, because mpconfig.h was not yet included.
2017-07-18all: Unify header guard usage.Alexander Steffen
The code conventions suggest using header guards, but do not define how those should look like and instead point to existing files. However, not all existing files follow the same scheme, sometimes omitting header guards altogether, sometimes using non-standard names, making it easy to accidentally pick a "wrong" example. This commit ensures that all header files of the MicroPython project (that were not simply copied from somewhere else) follow the same pattern, that was already present in the majority of files, especially in the py folder. The rules are as follows. Naming convention: * start with the words MICROPY_INCLUDED * contain the full path to the file * replace special characters with _ In addition, there are no empty lines before #ifndef, between #ifndef and one empty line before #endif. #endif is followed by a comment containing the name of the guard macro. py/grammar.h cannot use header guards by design, since it has to be included multiple times in a single C file. Several other files also do not need header guards as they are only used internally and guaranteed to be included only once: * MICROPY_MPHALPORT_H * mpconfigboard.h * mpconfigport.h * mpthreadport.h * pin_defs_*.h * qstrdefs*.h
2017-06-04extmod/modlwip: Fix error codes for duplicate calls to connect().Paul Sokolovsky
If socket is already connected, POSIX requires returning EISCONN. If connection was requested, but not yet complete (for non-blocking socket), error code is EALREADY. http://pubs.opengroup.org/onlinepubs/7908799/xns/connect.html
2016-05-28py/moduerrno: Add ECONNREFUSED, one of frequent networking errors.Paul Sokolovsky
2016-05-12py/objexcept: Don't convert errno to str in constructor, do it in print.Damien George
OSError's are now printed like: OSError: [Errno 1] EPERM but only if the string corresponding to the errno is found.
2016-05-12py: Add mp_errno_to_str() and use it to provide nicer OSError msgs.Damien George
If an OSError is raised with an integer argument, and that integer corresponds to an errno, then the string for the errno is used as the argument to the exception, instead of the integer. Only works if the uerrno module is enabled.
2016-05-12py/mperrno: Add some more MP_Exxx constants, related to networking.Damien George
2016-05-10py/mperrno: Add EAFNOSUPPORT definition.Damien George
2016-05-10py: Add mperrno.h file with uPy defined errno constants.Damien George