Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 97c3eb4

Browse files
Closes Issue 11916: Add a number of MacOSX specific definitions to the errno module.
Patch by Pierre Carrier.
1 parent 46070eb commit 97c3eb4

3 files changed

Lines changed: 59 additions & 0 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,3 +989,4 @@ Kai Zhu
989989
Tarek Ziadé
990990
Peter Åstrand
991991
Torsten Becker
992+
Pierre Carrier

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ Core and Builtins
140140
Library
141141
-------
142142

143+
- Issue 11916: Add a number of MacOSX specific definitions to the errno module.
144+
Patch by Pierre Carrier.
145+
143146
- Issue 11999: fixed sporadic sync failure mailbox.Maildir due to its trying to
144147
detect mtime changes by comparing to the system clock instead of to the
145148
previous value of the mtime.

Modules/errnomodule.c

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ PyInit_errno(void)
8484
* The names and comments are borrowed from linux/include/errno.h,
8585
* which should be pretty all-inclusive. However, the Solaris specific
8686
* names and comments are borrowed from sys/errno.h in Solaris.
87+
* MacOSX specific names and comments are borrowed from sys/errno.h in
88+
* MacOSX.
8789
*/
8890

8991
#ifdef ENODEV
@@ -848,6 +850,59 @@ PyInit_errno(void)
848850
inscode(d, ds, de, "ENOTACTIVE", ENOTACTIVE, "Facility is not active");
849851
#endif
850852

853+
/* MacOSX specific errnos */
854+
#ifdef EAUTH
855+
inscode(d, ds, de, "EAUTH", EAUTH, "Authentication error");
856+
#endif
857+
#ifdef EBADARCH
858+
inscode(d, ds, de, "EBADARCH", EBADARCH, "Bad CPU type in executable");
859+
#endif
860+
#ifdef EBADEXEC
861+
inscode(d, ds, de, "EBADEXEC", EBADEXEC, "Bad executable (or shared library)");
862+
#endif
863+
#ifdef EBADMACHO
864+
inscode(d, ds, de, "EBADMACHO", EBADMACHO, "Malformed Mach-o file");
865+
#endif
866+
#ifdef EBADRPC
867+
inscode(d, ds, de, "EBADRPC", EBADRPC, "RPC struct is bad");
868+
#endif
869+
#ifdef EDEVERR
870+
inscode(d, ds, de, "EDEVERR", EDEVERR, "Device error");
871+
#endif
872+
#ifdef EFTYPE
873+
inscode(d, ds, de, "EFTYPE", EFTYPE, "Inappropriate file type or format");
874+
#endif
875+
#ifdef ENEEDAUTH
876+
inscode(d, ds, de, "ENEEDAUTH", ENEEDAUTH, "Need authenticator");
877+
#endif
878+
#ifdef ENOATTR
879+
inscode(d, ds, de, "ENOATTR", ENOATTR, "Attribute not found");
880+
#endif
881+
#ifdef ENOPOLICY
882+
inscode(d, ds, de, "ENOPOLICY", ENOPOLICY, "Policy not found");
883+
#endif
884+
#ifdef EPROCLIM
885+
inscode(d, ds, de, "EPROCLIM", EPROCLIM, "Too many processes");
886+
#endif
887+
#ifdef EPROCUNAVAIL
888+
inscode(d, ds, de, "EPROCUNAVAIL", EPROCUNAVAIL, "Bad procedure for program");
889+
#endif
890+
#ifdef EPROGMISMATCH
891+
inscode(d, ds, de, "EPROGMISMATCH", EPROGMISMATCH, "Program version wrong");
892+
#endif
893+
#ifdef EPROGUNAVAIL
894+
inscode(d, ds, de, "EPROGUNAVAIL", EPROGUNAVAIL, "RPC prog. not avail");
895+
#endif
896+
#ifdef EPWROFF
897+
inscode(d, ds, de, "EPWROFF", EPWROFF, "Device power is off");
898+
#endif
899+
#ifdef ERPCMISMATCH
900+
inscode(d, ds, de, "ERPCMISMATCH", ERPCMISMATCH, "RPC version wrong");
901+
#endif
902+
#ifdef ESHLIBVERS
903+
inscode(d, ds, de, "ESHLIBVERS", ESHLIBVERS, "Shared library version mismatch");
904+
#endif
905+
851906
Py_DECREF(de);
852907
return m;
853908
}

0 commit comments

Comments
 (0)