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

Skip to content

Commit b85e165

Browse files
committed
Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
Matthew Ahrens.
1 parent 324ac65 commit b85e165

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and the list is in rough alphabetical order by last names.
1414
David Abrahams
1515
Jim Ahlstrom
1616
Farhan Ahmad
17+
Matthew Ahrens
1718
Nir Aides
1819
Yaniv Aknin
1920
Jyrki Alakuijala

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Core and Builtins
6363
Extensions
6464
----------
6565

66+
- Issue #5737: Add Solaris-specific mnemonics in the errno module. Patch by
67+
Matthew Ahrens.
68+
6669
- Restore GIL in nis_cat in case of error.
6770

6871
- Issue #665761: ``functools.reduce()`` will no longer mask exceptions

Modules/errnomodule.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ PyInit_errno(void)
8282

8383
/*
8484
* The names and comments are borrowed from linux/include/errno.h,
85-
* which should be pretty all-inclusive
85+
* which should be pretty all-inclusive. However, the Solaris specific
86+
* names and comments are borrowed from sys/errno.h in Solaris.
8687
*/
8788

8889
#ifdef ENODEV
@@ -797,6 +798,26 @@ PyInit_errno(void)
797798
inscode(d, ds, de, "WSAN", WSAN, "Error WSAN");
798799
#endif
799800

801+
/* Solaris-specific errnos */
802+
#ifdef ECANCELED
803+
inscode(d, ds, de, "ECANCELED", ECANCELED, "Operation canceled");
804+
#endif
805+
#ifdef ENOTSUP
806+
inscode(d, ds, de, "ENOTSUP", ENOTSUP, "Operation not supported");
807+
#endif
808+
#ifdef EOWNERDEAD
809+
inscode(d, ds, de, "EOWNERDEAD", EOWNERDEAD, "Process died with the lock");
810+
#endif
811+
#ifdef ENOTRECOVERABLE
812+
inscode(d, ds, de, "ENOTRECOVERABLE", ENOTRECOVERABLE, "Lock is not recoverable");
813+
#endif
814+
#ifdef ELOCKUNMAPPED
815+
inscode(d, ds, de, "ELOCKUNMAPPED", ELOCKUNMAPPED, "Locked lock was unmapped");
816+
#endif
817+
#ifdef ENOTACTIVE
818+
inscode(d, ds, de, "ENOTACTIVE", ENOTACTIVE, "Facility is not active");
819+
#endif
820+
800821
Py_DECREF(de);
801822
return m;
802823
}

0 commit comments

Comments
 (0)