Commit 4fbc72b4 authored by Christian Heimes's avatar Christian Heimes

Merged revisions...

Merged revisions 61687-61688,61696,61700,61704-61705,61707-61709,61711-61712,61714-61716,61718-61722 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r61687 | jeffrey.yasskin | 2008-03-21 06:02:44 +0100 (Fri, 21 Mar 2008) | 2 lines

  Speed up test_signal from ~24s to 4s by avoiding nearly all of the sleep calls.
........
  r61688 | jeffrey.yasskin | 2008-03-21 06:51:37 +0100 (Fri, 21 Mar 2008) | 5 lines

  Try to fix test_signal breakages on Linux due to r61687. It appears that at
  least two of the linux build bots aren't leaving zombie processes around for
  os.waitpid to wait for, causing ECHILD errors. This would be a symptom of a bug
  somewhere, but probably not in signal itself.
........
  r61696 | georg.brandl | 2008-03-21 15:32:33 +0100 (Fri, 21 Mar 2008) | 2 lines

  Mark the descitems in the tutorial as "noindex" so that :meth: cross-refs don't link to them.
........
  r61700 | georg.brandl | 2008-03-21 18:19:29 +0100 (Fri, 21 Mar 2008) | 2 lines

  Fix markup.
........
  r61704 | jeffrey.yasskin | 2008-03-21 19:25:06 +0100 (Fri, 21 Mar 2008) | 3 lines

  Try to fix test_signal on FreeBSD. I'm assuming that os.kill is failing to
  raise a signal, but switching to subprocess makes the code cleaner anyway.
........
  r61705 | jeffrey.yasskin | 2008-03-21 19:48:04 +0100 (Fri, 21 Mar 2008) | 7 lines

  Speed test_threading up from 14s to .5s, and avoid a deadlock on certain
  failures. The test for enumerate-after-join is now a little less rigorous, but
  the bug it references says the error happened in the first couple iterations,
  so 100 iterations should still be enough.

  cProfile was useful for identifying the slow tests here.
........
  r61707 | georg.brandl | 2008-03-21 20:14:38 +0100 (Fri, 21 Mar 2008) | 2 lines

  Fix a code block in __future__ docs.
........
  r61708 | georg.brandl | 2008-03-21 20:20:21 +0100 (Fri, 21 Mar 2008) | 2 lines

  Add docs for __func__ and __self__ on methods.
........
  r61709 | georg.brandl | 2008-03-21 20:37:57 +0100 (Fri, 21 Mar 2008) | 2 lines

  Add docs for print_function and future_builtins. Fixes #2442.
........
  r61711 | georg.brandl | 2008-03-21 20:54:00 +0100 (Fri, 21 Mar 2008) | 2 lines

  #2136: allow single quotes in realm spec.
........
  r61712 | georg.brandl | 2008-03-21 21:01:51 +0100 (Fri, 21 Mar 2008) | 3 lines

  Issue #2432: give DictReader the dialect and line_num attributes
  advertised in the docs.
........
  r61714 | georg.brandl | 2008-03-21 21:11:46 +0100 (Fri, 21 Mar 2008) | 2 lines

  #2358: add py3k warning to sys.exc_clear().
........
  r61715 | georg.brandl | 2008-03-21 21:21:46 +0100 (Fri, 21 Mar 2008) | 2 lines

  #2346/#2347: add py3k warning for __methods__ and __members__. Patch by Jack Diederich.
........
  r61716 | georg.brandl | 2008-03-21 21:38:24 +0100 (Fri, 21 Mar 2008) | 2 lines

  #2348: add py3k warning for file.softspace.
........
  r61718 | georg.brandl | 2008-03-21 21:55:20 +0100 (Fri, 21 Mar 2008) | 2 lines

  #2160: document PyImport_GetImporter.
........
  r61719 | georg.brandl | 2008-03-21 21:55:51 +0100 (Fri, 21 Mar 2008) | 2 lines

  Update doc ACKS.
........
  r61720 | steven.bethard | 2008-03-21 22:01:18 +0100 (Fri, 21 Mar 2008) | 1 line

  Replace hack in regrtest.py with use of sys.py3kwarning.
........
  r61721 | georg.brandl | 2008-03-21 22:05:03 +0100 (Fri, 21 Mar 2008) | 2 lines

  Add missing versionadded tag.
........
  r61722 | christian.heimes | 2008-03-22 00:49:44 +0100 (Sat, 22 Mar 2008) | 3 lines

  Applied patch #1657 epoll and kqueue wrappers for the select module
  The patch adds wrappers for the Linux epoll syscalls and the BSD kqueue syscalls. Thanks to Thomas Herve and the Twisted people for their support and help.
  TODO: Finish documentation documentation
........
parent 73a22f05
...@@ -21,6 +21,7 @@ docs@python.org), and we'll be glad to correct the problem. ...@@ -21,6 +21,7 @@ docs@python.org), and we'll be glad to correct the problem.
* Chris Barker * Chris Barker
* Don Bashford * Don Bashford
* Anthony Baxter * Anthony Baxter
* Alexander Belopolsky
* Bennett Benson * Bennett Benson
* Jonathan Black * Jonathan Black
* Robin Boerdijk * Robin Boerdijk
......
...@@ -134,6 +134,19 @@ Importing Modules ...@@ -134,6 +134,19 @@ Importing Modules
``sys.modules``). Note that this is a per-interpreter variable. ``sys.modules``). Note that this is a per-interpreter variable.
.. cfunction:: PyObject* PyImport_GetImporter(PyObject *path)
Return an importer object for a :data:`sys.path`/:attr:`pkg.__path__` item
*path*, possibly by fetching it from the :data:`sys.path_importer_cache`
dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook
is found that can handle the path item. Return ``None`` if no hook could;
this tells our caller it should fall back to the builtin import mechanism.
Cache the result in :data:`sys.path_importer_cache`. Return a new reference
to the importer object.
.. versionadded:: 2.6
.. cfunction:: void _PyImport_Init() .. cfunction:: void _PyImport_Init()
Initialize the import mechanism. For internal use only. Initialize the import mechanism. For internal use only.
......
:mod:`__future__` --- Future statement definitions :mod:`__future__` --- Future statement definitions
================================================== ==================================================
...@@ -22,8 +21,8 @@ ...@@ -22,8 +21,8 @@
Each statement in :file:`__future__.py` is of the form:: Each statement in :file:`__future__.py` is of the form::
FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease "," FeatureName = _Feature(OptionalRelease, MandatoryRelease,
CompilerFlag ")" CompilerFlag)
where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both are
......
:mod:`future_builtins` --- Python 3 builtins
============================================
.. module:: future_builtins
.. sectionauthor:: Georg Brandl
.. versionadded:: 2.6
This module provides functions that exist in 2.x, but have different behavior in
Python 3, so they cannot be put into the 2.x builtin namespace.
Instead, if you want to write code compatible with Python 3 builtins, import
them from this module, like this::
from future_builtins import map, filter
... code using Python 3-style map and filter ...
The :program:`2to3` tool that ports Python 2 code to Python 3 will recognize
this usage and leave the new builtins alone.
.. note::
The Python 3 :func:`print` function is already in the builtins, but cannot be
accessed from Python 2 code unless you use the appropriate future statement::
from __future__ import print_function
Available builtins are:
.. function:: filter(function, iterable)
Works like :func:`itertools.ifilter`.
.. function:: hex(object)
Works like the builtin :func:`hex`, but instead of :meth:`__hex__` it will
use the :meth:`__index__` method on its argument to get an integer that is
then converted to hexadecimal.
.. function:: map(function, iterable, ...)
Works like :func:`itertools.imap`.
.. function:: oct(object)
Works like the builtin :func:`oct`, but instead of :meth:`__oct__` it will
use the :meth:`__index__` method on its argument to get an integer that is
then converted to hexadecimal.
.. function:: zip(*iterables)
Works like :func:`itertools.izip`.
...@@ -14,6 +14,7 @@ overview: ...@@ -14,6 +14,7 @@ overview:
sys.rst sys.rst
builtins.rst builtins.rst
future_builtins.rst
__main__.rst __main__.rst
warnings.rst warnings.rst
contextlib.rst contextlib.rst
......
This diff is collapsed.
...@@ -599,3 +599,58 @@ The :mod:`xmlrpclib` module contains the following notice:: ...@@ -599,3 +599,58 @@ The :mod:`xmlrpclib` module contains the following notice::
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE. OF THIS SOFTWARE.
test_epoll
----------
The :mod:`test_epoll` contains the following notice::
Copyright (c) 2001-2006 Twisted Matrix Laboratories.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Select kqueue
-------------
The :mod:`select` and contains the following notice for the kqueue interface::
Copyright (c) 2000 Doug White, 2006 James Knight, 2007 Christian Heimes
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
...@@ -510,6 +510,10 @@ Callable types ...@@ -510,6 +510,10 @@ Callable types
An instance method object combines a class, a class instance and any An instance method object combines a class, a class instance and any
callable object (normally a user-defined function). callable object (normally a user-defined function).
.. versionchanged:: 2.6
For 3.0 forward-compatibility, :attr:`im_func` is also available as
:attr:`__func__`, and :attr:`im_self` as :attr:`__self__`.
.. index:: .. index::
single: __func__ (method attribute) single: __func__ (method attribute)
single: __self__ (method attribute) single: __self__ (method attribute)
......
...@@ -83,17 +83,20 @@ objects: ...@@ -83,17 +83,20 @@ objects:
.. method:: list.append(x) .. method:: list.append(x)
:noindex:
Add an item to the end of the list; equivalent to ``a[len(a):] = [x]``. Add an item to the end of the list; equivalent to ``a[len(a):] = [x]``.
.. method:: list.extend(L) .. method:: list.extend(L)
:noindex:
Extend the list by appending all the items in the given list; equivalent to Extend the list by appending all the items in the given list; equivalent to
``a[len(a):] = L``. ``a[len(a):] = L``.
.. method:: list.insert(i, x) .. method:: list.insert(i, x)
:noindex:
Insert an item at a given position. The first argument is the index of the Insert an item at a given position. The first argument is the index of the
element before which to insert, so ``a.insert(0, x)`` inserts at the front of element before which to insert, so ``a.insert(0, x)`` inserts at the front of
...@@ -101,12 +104,14 @@ objects: ...@@ -101,12 +104,14 @@ objects:
.. method:: list.remove(x) .. method:: list.remove(x)
:noindex:
Remove the first item from the list whose value is *x*. It is an error if there Remove the first item from the list whose value is *x*. It is an error if there
is no such item. is no such item.
.. method:: list.pop([i]) .. method:: list.pop([i])
:noindex:
Remove the item at the given position in the list, and return it. If no index Remove the item at the given position in the list, and return it. If no index
is specified, ``a.pop()`` removes and returns the last item in the list. (The is specified, ``a.pop()`` removes and returns the last item in the list. (The
...@@ -116,22 +121,26 @@ objects: ...@@ -116,22 +121,26 @@ objects:
.. method:: list.index(x) .. method:: list.index(x)
:noindex:
Return the index in the list of the first item whose value is *x*. It is an Return the index in the list of the first item whose value is *x*. It is an
error if there is no such item. error if there is no such item.
.. method:: list.count(x) .. method:: list.count(x)
:noindex:
Return the number of times *x* appears in the list. Return the number of times *x* appears in the list.
.. method:: list.sort() .. method:: list.sort()
:noindex:
Sort the items of the list, in place. Sort the items of the list, in place.
.. method:: list.reverse() .. method:: list.reverse()
:noindex:
Reverse the elements of the list, in place. Reverse the elements of the list, in place.
......
...@@ -540,7 +540,7 @@ complicated expressions inside a format string. ...@@ -540,7 +540,7 @@ complicated expressions inside a format string.
So far we've shown how to specify which field to substitute into the So far we've shown how to specify which field to substitute into the
resulting string. The precise formatting used is also controllable by resulting string. The precise formatting used is also controllable by
adding a colon followed by a format specifier. For example: adding a colon followed by a format specifier. For example::
# Field 0: left justify, pad to 15 characters # Field 0: left justify, pad to 15 characters
# Field 1: right justify, pad to 6 characters # Field 1: right justify, pad to 6 characters
...@@ -552,7 +552,7 @@ adding a colon followed by a format specifier. For example: ...@@ -552,7 +552,7 @@ adding a colon followed by a format specifier. For example:
fmt.format('Banquet', 125) -> fmt.format('Banquet', 125) ->
'Banquet $ 125' 'Banquet $ 125'
Format specifiers can reference other fields through nesting: Format specifiers can reference other fields through nesting::
fmt = '{0:{1}}' fmt = '{0:{1}}'
fmt.format('Invoice #1234', width) -> fmt.format('Invoice #1234', width) ->
......
...@@ -72,6 +72,8 @@ class DictReader: ...@@ -72,6 +72,8 @@ class DictReader:
self.restkey = restkey # key to catch long rows self.restkey = restkey # key to catch long rows
self.restval = restval # default value for short rows self.restval = restval # default value for short rows
self.reader = reader(f, dialect, *args, **kwds) self.reader = reader(f, dialect, *args, **kwds)
self.dialect = dialect
self.line_num = 0
def __iter__(self): def __iter__(self):
return self return self
...@@ -81,6 +83,7 @@ class DictReader: ...@@ -81,6 +83,7 @@ class DictReader:
if self.fieldnames is None: if self.fieldnames is None:
self.fieldnames = row self.fieldnames = row
row = next(self.reader) row = next(self.reader)
self.line_num = self.reader.line_num
# unlike the basic reader, we prefer not to return blanks, # unlike the basic reader, we prefer not to return blanks,
# because we will typically wind up with a dict full of None # because we will typically wind up with a dict full of None
......
...@@ -873,10 +873,12 @@ _expectations = { ...@@ -873,10 +873,12 @@ _expectations = {
test_dl test_dl
test_fcntl test_fcntl
test_fork1 test_fork1
test_epoll
test_gdbm test_gdbm
test_grp test_grp
test_ioctl test_ioctl
test_largefile test_largefile
test_kqueue
test_mhlib test_mhlib
test_openpty test_openpty
test_ossaudiodev test_ossaudiodev
...@@ -897,6 +899,7 @@ _expectations = { ...@@ -897,6 +899,7 @@ _expectations = {
test_curses test_curses
test_dl test_dl
test_largefile test_largefile
test_kqueue
test_ossaudiodev test_ossaudiodev
""", """,
'mac': 'mac':
...@@ -912,10 +915,12 @@ _expectations = { ...@@ -912,10 +915,12 @@ _expectations = {
test_dl test_dl
test_fcntl test_fcntl
test_fork1 test_fork1
test_epoll
test_grp test_grp
test_ioctl test_ioctl
test_largefile test_largefile
test_locale test_locale
test_kqueue
test_mmap test_mmap
test_openpty test_openpty
test_ossaudiodev test_ossaudiodev
...@@ -933,7 +938,9 @@ _expectations = { ...@@ -933,7 +938,9 @@ _expectations = {
""" """
test_bsddb test_bsddb
test_dl test_dl
test_epoll
test_largefile test_largefile
test_kqueue
test_minidom test_minidom
test_openpty test_openpty
test_pyexpat test_pyexpat
...@@ -944,7 +951,9 @@ _expectations = { ...@@ -944,7 +951,9 @@ _expectations = {
""" """
test_bsddb test_bsddb
test_dl test_dl
test_epoll
test_largefile test_largefile
test_kqueue
test_minidom test_minidom
test_openpty test_openpty
test_pyexpat test_pyexpat
...@@ -957,9 +966,11 @@ _expectations = { ...@@ -957,9 +966,11 @@ _expectations = {
test_bsddb test_bsddb
test_dl test_dl
test_fork1 test_fork1
test_epoll
test_gettext test_gettext
test_largefile test_largefile
test_locale test_locale
test_kqueue
test_minidom test_minidom
test_openpty test_openpty
test_pyexpat test_pyexpat
...@@ -977,9 +988,11 @@ _expectations = { ...@@ -977,9 +988,11 @@ _expectations = {
test_bsddb test_bsddb
test_bsddb3 test_bsddb3
test_curses test_curses
test_epoll
test_gdbm test_gdbm
test_largefile test_largefile
test_locale test_locale
test_minidom
test_ossaudiodev test_ossaudiodev
test_poll test_poll
""", """,
...@@ -988,6 +1001,8 @@ _expectations = { ...@@ -988,6 +1001,8 @@ _expectations = {
test_bsddb test_bsddb
test_curses test_curses
test_dbm test_dbm
test_epoll
test_kqueue
test_gdbm test_gdbm
test_gzip test_gzip
test_openpty test_openpty
...@@ -999,10 +1014,12 @@ _expectations = { ...@@ -999,10 +1014,12 @@ _expectations = {
test_bsddb test_bsddb
test_curses test_curses
test_dl test_dl
test_epoll
test_gdbm test_gdbm
test_gzip test_gzip
test_largefile test_largefile
test_locale test_locale
test_kqueue
test_minidom test_minidom
test_openpty test_openpty
test_pyexpat test_pyexpat
...@@ -1015,8 +1032,10 @@ _expectations = { ...@@ -1015,8 +1032,10 @@ _expectations = {
test_curses test_curses
test_dl test_dl
test_gdbm test_gdbm
test_epoll
test_largefile test_largefile
test_locale test_locale
test_kqueue
test_mhlib test_mhlib
test_mmap test_mmap
test_poll test_poll
...@@ -1027,7 +1046,9 @@ _expectations = { ...@@ -1027,7 +1046,9 @@ _expectations = {
test_bsddb3 test_bsddb3
test_curses test_curses
test_dbm test_dbm
test_epoll
test_ioctl test_ioctl
test_kqueue
test_largefile test_largefile
test_locale test_locale
test_ossaudiodev test_ossaudiodev
...@@ -1040,6 +1061,8 @@ _expectations = { ...@@ -1040,6 +1061,8 @@ _expectations = {
test_commands test_commands
test_curses test_curses
test_dl test_dl
test_epoll
test_kqueue
test_largefile test_largefile
test_mhlib test_mhlib
test_mmap test_mmap
...@@ -1053,6 +1076,7 @@ _expectations = { ...@@ -1053,6 +1076,7 @@ _expectations = {
""" """
test_bsddb test_bsddb
test_bsddb3 test_bsddb3
test_epoll
test_gdbm test_gdbm
test_locale test_locale
test_ossaudiodev test_ossaudiodev
...@@ -1069,8 +1093,10 @@ _expectations = { ...@@ -1069,8 +1093,10 @@ _expectations = {
test_bsddb3 test_bsddb3
test_bz2 test_bz2
test_dl test_dl
test_epoll
test_gdbm test_gdbm
test_gzip test_gzip
test_kqueue
test_ossaudiodev test_ossaudiodev
test_tcl test_tcl
test_zipimport test_zipimport
...@@ -1082,6 +1108,7 @@ _expectations = { ...@@ -1082,6 +1108,7 @@ _expectations = {
test_bsddb3 test_bsddb3
test_ctypes test_ctypes
test_dl test_dl
test_epoll
test_gdbm test_gdbm
test_locale test_locale
test_normalization test_normalization
...@@ -1096,6 +1123,7 @@ _expectations = { ...@@ -1096,6 +1123,7 @@ _expectations = {
test_ctypes test_ctypes
test_curses test_curses
test_dl test_dl
test_epoll
test_gdbm test_gdbm
test_locale test_locale
test_ossaudiodev test_ossaudiodev
......
# Copyright (c) 2001-2006 Twisted Matrix Laboratories.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""
Tests for epoll wrapper.
"""
import os
import socket
import errno
import time
import select
import tempfile
import unittest
from test import test_support
if not hasattr(select, "epoll"):
raise test_support.TestSkipped("test works only on Linux 2.6")
class TestEPoll(unittest.TestCase):
def setUp(self):
self.serverSocket = socket.socket()
self.serverSocket.bind(('127.0.0.1', 0))
self.serverSocket.listen(1)
self.connections = [self.serverSocket]
def tearDown(self):
for skt in self.connections:
skt.close()
def _connected_pair(self):
client = socket.socket()
client.setblocking(False)
try:
client.connect(('127.0.0.1', self.serverSocket.getsockname()[1]))
except socket.error as e:
self.assertEquals(e.args[0], errno.EINPROGRESS)
else:
raise AssertionError("Connect should have raised EINPROGRESS")
server, addr = self.serverSocket.accept()
self.connections.extend((client, server))
return client, server
def test_create(self):
try:
ep = select.epoll(16)
except OSError as e:
raise AssertionError(str(e))
self.assert_(ep.fileno() > 0, ep.fileno())
self.assert_(not ep.closed)
ep.close()
self.assert_(ep.closed)
self.assertRaises(ValueError, ep.fileno)
def test_badcreate(self):
self.assertRaises(TypeError, select.epoll, 1, 2, 3)
self.assertRaises(TypeError, select.epoll, 'foo')
self.assertRaises(TypeError, select.epoll, None)
self.assertRaises(TypeError, select.epoll, ())
self.assertRaises(TypeError, select.epoll, ['foo'])
self.assertRaises(TypeError, select.epoll, {})
def test_add(self):
server, client = self._connected_pair()
ep = select.epoll(2)
try:
ep.register(server.fileno(), select.EPOLLIN | select.EPOLLOUT)
ep.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT)
finally:
ep.close()
def test_fromfd(self):
server, client = self._connected_pair()
ep = select.epoll(2)
ep2 = select.epoll.fromfd(ep.fileno())
ep2.register(server.fileno(), select.EPOLLIN | select.EPOLLOUT)
ep2.register(client.fileno(), select.EPOLLIN | select.EPOLLOUT)
events = ep.poll(1, 4)
events2 = ep2.poll(0.9, 4)
self.assertEqual(len(events), 2)
self.assertEqual(len(events2), 2)
ep.close()
try:
ep2.poll(1, 4)
except IOError as e:
self.failUnlessEqual(e.args[0], errno.EBADF, e)
else:
self.fail("epoll on closed fd didn't raise EBADF")
def test_control_and_wait(self):
client, server = self._connected_pair()
ep = select.epoll(16)
ep.register(server.fileno(),
select.EPOLLIN | select.EPOLLOUT | select.EPOLLET)
ep.register(client.fileno(),
select.EPOLLIN | select.EPOLLOUT | select.EPOLLET)
now = time.time()
events = ep.poll(1, 4)
then = time.time()
self.failIf(then - now > 0.1, then - now)
events.sort()
expected = [(client.fileno(), select.EPOLLOUT),
(server.fileno(), select.EPOLLOUT)]
expected.sort()
self.assertEquals(events, expected)
self.failIf(then - now > 0.01, then - now)
now = time.time()
events = ep.poll(timeout=2.1, maxevents=4)
then = time.time()
self.failIf(events)
client.send(b"Hello!")
server.send(b"world!!!")
now = time.time()
events = ep.poll(1, 4)
then = time.time()
self.failIf(then - now > 0.01)
events.sort()
expected = [(client.fileno(), select.EPOLLIN | select.EPOLLOUT),
(server.fileno(), select.EPOLLIN | select.EPOLLOUT)]
expected.sort()
self.assertEquals(events, expected)
ep.unregister(client.fileno())
ep.modify(server.fileno(), select.EPOLLOUT)
now = time.time()
events = ep.poll(1, 4)
then = time.time()
self.failIf(then - now > 0.01)
expected = [(server.fileno(), select.EPOLLOUT)]
self.assertEquals(events, expected)
def test_errors(self):
self.assertRaises(ValueError, select.epoll, -2)
self.assertRaises(ValueError, select.epoll().register, -1,
select.EPOLLIN)
def test_unregister_closed(self):
server, client = self._connected_pair()
fd = server.fileno()
ep = select.epoll(16)
ep.register(server)
now = time.time()
events = ep.poll(1, 4)
then = time.time()
self.failIf(then - now > 0.01)
server.close()
ep.unregister(fd)
def test_main():
test_support.run_unittest(TestEPoll)
if __name__ == "__main__":
test_main()
"""
Tests for kqueue wrapper.
"""
import socket
import errno
import time
import select
import sys
import unittest
from test import test_support
if not hasattr(select, "kqueue"):
raise test_support.TestSkipped("test works only on BSD")
class TestKQueue(unittest.TestCase):
def test_create_queue(self):
kq = select.kqueue()
self.assert_(kq.fileno() > 0, kq.fileno())
self.assert_(not kq.closed)
kq.close()
self.assert_(kq.closed)
self.assertRaises(ValueError, kq.fileno)
def test_create_event(self):
fd = sys.stderr.fileno()
ev = select.kevent(fd)
other = select.kevent(1000)
self.assertEqual(ev.ident, fd)
self.assertEqual(ev.filter, select.KQ_FILTER_READ)
self.assertEqual(ev.flags, select.KQ_EV_ADD)
self.assertEqual(ev.fflags, 0)
self.assertEqual(ev.data, 0)
self.assertEqual(ev.udata, 0)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
self.assertEqual(cmp(ev, other), -1)
self.assert_(ev < other)
self.assert_(other >= ev)
self.assertRaises(TypeError, cmp, ev, None)
self.assertRaises(TypeError, cmp, ev, 1)
self.assertRaises(TypeError, cmp, ev, "ev")
ev = select.kevent(fd, select.KQ_FILTER_WRITE)
self.assertEqual(ev.ident, fd)
self.assertEqual(ev.filter, select.KQ_FILTER_WRITE)
self.assertEqual(ev.flags, select.KQ_EV_ADD)
self.assertEqual(ev.fflags, 0)
self.assertEqual(ev.data, 0)
self.assertEqual(ev.udata, 0)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
ev = select.kevent(fd, select.KQ_FILTER_WRITE, select.KQ_EV_ONESHOT)
self.assertEqual(ev.ident, fd)
self.assertEqual(ev.filter, select.KQ_FILTER_WRITE)
self.assertEqual(ev.flags, select.KQ_EV_ONESHOT)
self.assertEqual(ev.fflags, 0)
self.assertEqual(ev.data, 0)
self.assertEqual(ev.udata, 0)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
ev = select.kevent(1, 2, 3, 4, 5, 6)
self.assertEqual(ev.ident, 1)
self.assertEqual(ev.filter, 2)
self.assertEqual(ev.flags, 3)
self.assertEqual(ev.fflags, 4)
self.assertEqual(ev.data, 5)
self.assertEqual(ev.udata, 6)
self.assertEqual(ev, ev)
self.assertNotEqual(ev, other)
def test_queue_event(self):
serverSocket = socket.socket()
serverSocket.bind(('127.0.0.1', 0))
serverSocket.listen(1)
client = socket.socket()
client.setblocking(False)
try:
client.connect(('127.0.0.1', serverSocket.getsockname()[1]))
except socket.error as e:
self.assertEquals(e.args[0], errno.EINPROGRESS)
else:
#raise AssertionError("Connect should have raised EINPROGRESS")
pass # FreeBSD doesn't raise an exception here
server, addr = serverSocket.accept()
if sys.platform.startswith("darwin"):
flags = select.KQ_EV_ADD | select.KQ_EV_ENABLE
else:
flags = 0
kq = select.kqueue()
kq2 = select.kqueue.fromfd(kq.fileno())
ev = select.kevent(server.fileno(),
select.KQ_FILTER_WRITE,
select.KQ_EV_ADD | select.KQ_EV_ENABLE)
kq.control([ev], 0)
ev = select.kevent(server.fileno(),
select.KQ_FILTER_READ,
select.KQ_EV_ADD | select.KQ_EV_ENABLE)
kq.control([ev], 0)
ev = select.kevent(client.fileno(),
select.KQ_FILTER_WRITE,
select.KQ_EV_ADD | select.KQ_EV_ENABLE)
kq2.control([ev], 0)
ev = select.kevent(client.fileno(),
select.KQ_FILTER_READ,
select.KQ_EV_ADD | select.KQ_EV_ENABLE)
kq2.control([ev], 0)
events = kq.control(None, 4, 1)
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
self.assertEquals(events, [
(client.fileno(), select.KQ_FILTER_WRITE, flags),
(server.fileno(), select.KQ_FILTER_WRITE, flags)])
client.send(b"Hello!")
server.send(b"world!!!")
events = kq.control(None, 4, 1)
# We may need to call it several times
for i in range(5):
if len(events) == 4:
break
events = kq.control(None, 4, 1)
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
self.assertEquals(events, [
(client.fileno(), select.KQ_FILTER_WRITE, flags),
(client.fileno(), select.KQ_FILTER_READ, flags),
(server.fileno(), select.KQ_FILTER_WRITE, flags),
(server.fileno(), select.KQ_FILTER_READ, flags)])
# Remove completely client, and server read part
ev = select.kevent(client.fileno(),
select.KQ_FILTER_WRITE,
select.KQ_EV_DELETE)
kq.control([ev], 0)
ev = select.kevent(client.fileno(),
select.KQ_FILTER_READ,
select.KQ_EV_DELETE)
kq.control([ev], 0)
ev = select.kevent(server.fileno(),
select.KQ_FILTER_READ,
select.KQ_EV_DELETE)
kq.control([ev], 0, 0)
events = kq.control([], 4, 0.99)
events = [(e.ident, e.filter, e.flags) for e in events]
events.sort()
self.assertEquals(events, [
(server.fileno(), select.KQ_FILTER_WRITE, flags)])
client.close()
server.close()
serverSocket.close()
def test_main():
test_support.run_unittest(TestKQueue)
if __name__ == "__main__":
test_main()
...@@ -34,7 +34,8 @@ class PollTests(unittest.TestCase): ...@@ -34,7 +34,8 @@ class PollTests(unittest.TestCase):
for i in range(NUM_PIPES): for i in range(NUM_PIPES):
rd, wr = os.pipe() rd, wr = os.pipe()
p.register(rd, select.POLLIN) p.register(rd)
p.modify(rd, select.POLLIN)
p.register(wr, select.POLLOUT) p.register(wr, select.POLLOUT)
readers.append(rd) readers.append(rd)
writers.append(wr) writers.append(wr)
......
This diff is collapsed.
...@@ -30,32 +30,26 @@ class TestThread(threading.Thread): ...@@ -30,32 +30,26 @@ class TestThread(threading.Thread):
self.nrunning = nrunning self.nrunning = nrunning
def run(self): def run(self):
delay = random.random() * 2 delay = random.random() / 10000.0
if verbose: if verbose:
print('task', self.getName(), 'will run for', delay, 'sec') print('task', self.getName(), 'will run for', delay, 'sec')
self.sema.acquire() with self.sema:
with self.mutex:
self.nrunning.inc()
if verbose:
print(self.nrunning.get(), 'tasks are running')
self.testcase.assert_(self.nrunning.get() <= 3)
self.mutex.acquire() time.sleep(delay)
self.nrunning.inc() if verbose:
if verbose: print('task', self.getName(), 'done')
print(self.nrunning.get(), 'tasks are running') with self.mutex:
self.testcase.assert_(self.nrunning.get() <= 3) self.nrunning.dec()
self.mutex.release() self.testcase.assert_(self.nrunning.get() >= 0)
if verbose:
time.sleep(delay) print('%s is finished. %d tasks are running' %
if verbose: self.getName(), self.nrunning.get())
print('task', self.getName(), 'done')
self.mutex.acquire()
self.nrunning.dec()
self.testcase.assert_(self.nrunning.get() >= 0)
if verbose:
print(self.getName(), 'is finished.', self.nrunning.get(), \
'tasks are running')
self.mutex.release()
self.sema.release()
class ThreadTests(unittest.TestCase): class ThreadTests(unittest.TestCase):
...@@ -218,6 +212,10 @@ class ThreadTests(unittest.TestCase): ...@@ -218,6 +212,10 @@ class ThreadTests(unittest.TestCase):
rc = subprocess.call([sys.executable, "-c", """if 1: rc = subprocess.call([sys.executable, "-c", """if 1:
import ctypes, sys, time, thread import ctypes, sys, time, thread
# This lock is used as a simple event variable.
ready = thread.allocate_lock()
ready.acquire()
# Module globals are cleared before __del__ is run # Module globals are cleared before __del__ is run
# So we save the functions in class dict # So we save the functions in class dict
class C: class C:
...@@ -229,10 +227,11 @@ class ThreadTests(unittest.TestCase): ...@@ -229,10 +227,11 @@ class ThreadTests(unittest.TestCase):
def waitingThread(): def waitingThread():
x = C() x = C()
ready.release()
time.sleep(100) time.sleep(100)
thread.start_new_thread(waitingThread, ()) thread.start_new_thread(waitingThread, ())
time.sleep(1) # be sure the other thread is waiting ready.acquire() # Be sure the other thread is waiting.
sys.exit(42) sys.exit(42)
"""]) """])
self.assertEqual(rc, 42) self.assertEqual(rc, 42)
...@@ -242,7 +241,6 @@ class ThreadTests(unittest.TestCase): ...@@ -242,7 +241,6 @@ class ThreadTests(unittest.TestCase):
# threading.enumerate() after it has been join()ed. # threading.enumerate() after it has been join()ed.
enum = threading.enumerate enum = threading.enumerate
old_interval = sys.getcheckinterval() old_interval = sys.getcheckinterval()
sys.setcheckinterval(1)
try: try:
for i in range(1, 1000): for i in range(1, 1000):
t = threading.Thread(target=lambda: None) t = threading.Thread(target=lambda: None)
......
...@@ -906,13 +906,14 @@ class HandlerTests(unittest.TestCase): ...@@ -906,13 +906,14 @@ class HandlerTests(unittest.TestCase):
self.assertEqual([(handlers[0], "http_open")], self.assertEqual([(handlers[0], "http_open")],
[tup[0:2] for tup in o.calls]) [tup[0:2] for tup in o.calls])
def test_basic_auth(self): def test_basic_auth(self, quote_char='"'):
opener = OpenerDirector() opener = OpenerDirector()
password_manager = MockPasswordManager() password_manager = MockPasswordManager()
auth_handler = urllib2.HTTPBasicAuthHandler(password_manager) auth_handler = urllib2.HTTPBasicAuthHandler(password_manager)
realm = "ACME Widget Store" realm = "ACME Widget Store"
http_handler = MockHTTPHandler( http_handler = MockHTTPHandler(
401, 'WWW-Authenticate: Basic realm="%s"\r\n\r\n' % realm) 401, 'WWW-Authenticate: Basic realm=%s%s%s\r\n\r\n' %
(quote_char, realm, quote_char) )
opener.add_handler(auth_handler) opener.add_handler(auth_handler)
opener.add_handler(http_handler) opener.add_handler(http_handler)
self._test_basic_auth(opener, auth_handler, "Authorization", self._test_basic_auth(opener, auth_handler, "Authorization",
...@@ -921,6 +922,9 @@ class HandlerTests(unittest.TestCase): ...@@ -921,6 +922,9 @@ class HandlerTests(unittest.TestCase):
"http://acme.example.com/protected", "http://acme.example.com/protected",
) )
def test_basic_auth_with_single_quoted_realm(self):
self.test_basic_auth(quote_char="'")
def test_proxy_basic_auth(self): def test_proxy_basic_auth(self):
opener = OpenerDirector() opener = OpenerDirector()
ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128")) ph = urllib2.ProxyHandler(dict(http="proxy.example.com:3128"))
......
...@@ -777,7 +777,10 @@ class AbstractBasicAuthHandler: ...@@ -777,7 +777,10 @@ class AbstractBasicAuthHandler:
# XXX this allows for multiple auth-schemes, but will stupidly pick # XXX this allows for multiple auth-schemes, but will stupidly pick
# the last one with a realm specified. # the last one with a realm specified.
rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', re.I) # allow for double- and single-quoted realm values
# (single quotes are a violation of the RFC, but appear in the wild)
rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+'
'realm=(["\'])(.*?)\\2', re.I)
# XXX could pre-emptively send auth info already accepted (RFC 2617, # XXX could pre-emptively send auth info already accepted (RFC 2617,
# end of section 2, and section 1.2 immediately after "credentials" # end of section 2, and section 1.2 immediately after "credentials"
...@@ -797,7 +800,7 @@ class AbstractBasicAuthHandler: ...@@ -797,7 +800,7 @@ class AbstractBasicAuthHandler:
if authreq: if authreq:
mo = AbstractBasicAuthHandler.rx.search(authreq) mo = AbstractBasicAuthHandler.rx.search(authreq)
if mo: if mo:
scheme, realm = mo.groups() scheme, quote, realm = mo.groups()
if scheme.lower() == 'basic': if scheme.lower() == 'basic':
return self.retry_http_basic_auth(host, req, realm) return self.retry_http_basic_auth(host, req, realm)
......
This diff is collapsed.
...@@ -5387,6 +5387,8 @@ done ...@@ -5387,6 +5387,8 @@ done
...@@ -5395,8 +5397,8 @@ fcntl.h grp.h \ ...@@ -5395,8 +5397,8 @@ fcntl.h grp.h \
io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
shadow.h signal.h stdint.h stropts.h termios.h thread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \
unistd.h utime.h \ unistd.h utime.h \
sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
sys/modem.h \ sys/lock.h sys/mkdev.h sys/modem.h \
sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/time.h \ sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
...@@ -16130,7 +16132,111 @@ echo "${ECHO_T}no" >&6; } ...@@ -16130,7 +16132,111 @@ echo "${ECHO_T}no" >&6; }
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: checking for epoll" >&5
echo $ECHO_N "checking for epoll... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/epoll.h>
int
main ()
{
void *x=epoll_create
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_EPOLL 1
_ACEOF
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ echo "$as_me:$LINENO: checking for kqueue" >&5
echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/event.h>
int
main ()
{
int x=kqueue()
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_KQUEUE 1
_ACEOF
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
# On some systems (eg. FreeBSD 5), we would find a definition of the # On some systems (eg. FreeBSD 5), we would find a definition of the
# functions ctermid_r, setgroups in the library, but no prototype # functions ctermid_r, setgroups in the library, but no prototype
# (e.g. because we use _XOPEN_SOURCE). See whether we can take their # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
......
...@@ -1077,8 +1077,8 @@ fcntl.h grp.h \ ...@@ -1077,8 +1077,8 @@ fcntl.h grp.h \
io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \ io.h langinfo.h libintl.h ncurses.h poll.h process.h pthread.h \
shadow.h signal.h stdint.h stropts.h termios.h thread.h \ shadow.h signal.h stdint.h stropts.h termios.h thread.h \
unistd.h utime.h \ unistd.h utime.h \
sys/audioio.h sys/bsdtty.h sys/file.h sys/loadavg.h sys/lock.h sys/mkdev.h \ sys/audioio.h sys/bsdtty.h sys/epoll.h sys/event.h sys/file.h sys/loadavg.h \
sys/modem.h \ sys/lock.h sys/mkdev.h sys/modem.h \
sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/time.h \ sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \ sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
...@@ -2325,7 +2325,21 @@ AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync, ...@@ -2325,7 +2325,21 @@ AC_TRY_COMPILE([#include <unistd.h>], void *x=fdatasync,
AC_MSG_RESULT(yes), AC_MSG_RESULT(yes),
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
) )
AC_MSG_CHECKING(for epoll)
AC_TRY_COMPILE([#include <sys/epoll.h>], void *x=epoll_create,
AC_DEFINE(HAVE_EPOLL, 1, Define if you have the 'epoll' functions.)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for kqueue)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/event.h>
], int x=kqueue(),
AC_DEFINE(HAVE_KQUEUE, 1, Define if you have the 'kqueue' functions.)
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
# On some systems (eg. FreeBSD 5), we would find a definition of the # On some systems (eg. FreeBSD 5), we would find a definition of the
# functions ctermid_r, setgroups in the library, but no prototype # functions ctermid_r, setgroups in the library, but no prototype
# (e.g. because we use _XOPEN_SOURCE). See whether we can take their # (e.g. because we use _XOPEN_SOURCE). See whether we can take their
......
...@@ -144,6 +144,9 @@ ...@@ -144,6 +144,9 @@
/* Defined when any dynamic module loading is enabled. */ /* Defined when any dynamic module loading is enabled. */
#undef HAVE_DYNAMIC_LOADING #undef HAVE_DYNAMIC_LOADING
/* Define if you have the 'epoll' functions. */
#undef HAVE_EPOLL
/* Define to 1 if you have the <errno.h> header file. */ /* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H #undef HAVE_ERRNO_H
...@@ -315,6 +318,9 @@ ...@@ -315,6 +318,9 @@
/* Define to 1 if you have the `killpg' function. */ /* Define to 1 if you have the `killpg' function. */
#undef HAVE_KILLPG #undef HAVE_KILLPG
/* Define if you have the 'kqueue' functions. */
#undef HAVE_KQUEUE
/* Define to 1 if you have the <langinfo.h> header file. */ /* Define to 1 if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H #undef HAVE_LANGINFO_H
...@@ -630,6 +636,12 @@ ...@@ -630,6 +636,12 @@
*/ */
#undef HAVE_SYS_DIR_H #undef HAVE_SYS_DIR_H
/* Define to 1 if you have the <sys/epoll.h> header file. */
#undef HAVE_SYS_EPOLL_H
/* Define to 1 if you have the <sys/event.h> header file. */
#undef HAVE_SYS_EVENT_H
/* Define to 1 if you have the <sys/file.h> header file. */ /* Define to 1 if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H #undef HAVE_SYS_FILE_H
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment