aboutsummaryrefslogtreecommitdiff
path: root/stmhal/moduselect.c
diff options
context:
space:
mode:
authorPaul Sokolovsky2015-11-09 22:10:01 +0200
committerPaul Sokolovsky2015-11-09 22:10:31 +0200
commit746b752b8efd089c8dd37e615949315973a8d370 (patch)
treed1a08a928fd5ba64c08fa26391364e7dc2073adc /stmhal/moduselect.c
parent1f92ffb5b7e3404e9a290f3e5ab95dc98a28753e (diff)
stmhal/moduselect: Expose POLLIN/OUT/ERR/HUP constants.
This makes select.poll() interface fully compatible with CpYthon. Also, make their numeric values of these options compatible with Linux (and by extension, with iBCS2 standard, which jopefully means compatibility with other Unices too).
Diffstat (limited to 'stmhal/moduselect.c')
-rw-r--r--stmhal/moduselect.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/stmhal/moduselect.c b/stmhal/moduselect.c
index 232520ec4..592c3fa3f 100644
--- a/stmhal/moduselect.c
+++ b/stmhal/moduselect.c
@@ -285,6 +285,10 @@ STATIC const mp_map_elem_t mp_module_select_globals_table[] = {
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_uselect) },
{ MP_OBJ_NEW_QSTR(MP_QSTR_select), (mp_obj_t)&mp_select_select_obj },
{ MP_OBJ_NEW_QSTR(MP_QSTR_poll), (mp_obj_t)&mp_select_poll_obj },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_POLLIN), MP_OBJ_NEW_SMALL_INT(MP_IOCTL_POLL_RD) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_POLLOUT), MP_OBJ_NEW_SMALL_INT(MP_IOCTL_POLL_WR) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_POLLERR), MP_OBJ_NEW_SMALL_INT(MP_IOCTL_POLL_ERR) },
+ { MP_OBJ_NEW_QSTR(MP_QSTR_POLLHUP), MP_OBJ_NEW_SMALL_INT(MP_IOCTL_POLL_HUP) },
};
STATIC MP_DEFINE_CONST_DICT(mp_module_select_globals, mp_module_select_globals_table);