summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-05-16 13:10:15 (GMT)
committerGeorg Brandl <georg@python.org>2008-05-16 13:10:15 (GMT)
commit5049a858baf3500af5d4eb12838f028aabefc35b (patch)
tree196f2c8b004f26a074def3cd654766c5eb821f02
parentca21c65a237f1fbeb6b71ad124c31e9b59a41c98 (diff)
downloadcpython-5049a858baf3500af5d4eb12838f028aabefc35b.zip
cpython-5049a858baf3500af5d4eb12838f028aabefc35b.tar.gz
cpython-5049a858baf3500af5d4eb12838f028aabefc35b.tar.bz2
#2890: support os.O_ASYNC and fcntl.FASYNC.
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/fcntlmodule.c3
-rw-r--r--Modules/posixmodule.c5
3 files changed, 10 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 116e4b9..fa6f5e9 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,8 @@ Core and Builtins
Extension Modules
-----------------
+- Support os.O_ASYNC and fcntl.FASYNC if the constants exist on the platform.
+
- Support for Windows 9x has been removed from the winsound module.
- bsddb module updated to version 4.6.4.
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 96a6cc8..0c85f47 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -510,6 +510,9 @@ all_ins(PyObject* d)
if (ins(d, "F_SETLKW64", (long)F_SETLKW64)) return -1;
#endif
/* GNU extensions, as of glibc 2.2.4. */
+#ifdef FASYNC
+ if (ins(d, "FASYNC", (long)FASYNC)) return -1;
+#endif
#ifdef F_SETLEASE
if (ins(d, "F_SETLEASE", (long)F_SETLEASE)) return -1;
#endif
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 6a72166..a4bbac5 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8756,6 +8756,11 @@ all_ins(PyObject *d)
#endif
/* GNU extensions. */
+#ifdef O_ASYNC
+ /* Send a SIGIO signal whenever input or output
+ becomes available on file descriptor */
+ if (ins(d, "O_ASYNC", (long)O_ASYNC)) return -1;
+#endif
#ifdef O_DIRECT
/* Direct disk access. */
if (ins(d, "O_DIRECT", (long)O_DIRECT)) return -1;