Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e62c5c88
Kaydet (Commit)
e62c5c88
authored
Mar 21, 2004
tarafından
Nicholas Bastin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added configure check for broken poll() on some unix systems (MacOS X 10.3)
Fixes SF Bug #850981
üst
3f606292
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
128 additions
and
7 deletions
+128
-7
selectmodule.c
Modules/selectmodule.c
+6
-6
configure
configure
+73
-1
configure.in
configure.in
+37
-0
pyconfig.h.in
pyconfig.h.in
+12
-0
No files found.
Modules/selectmodule.c
Dosyayı görüntüle @
e62c5c88
...
@@ -318,7 +318,7 @@ select_select(PyObject *self, PyObject *args)
...
@@ -318,7 +318,7 @@ select_select(PyObject *self, PyObject *args)
return
ret
;
return
ret
;
}
}
#if
def HAVE_POLL
#if
defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
/*
/*
* poll() support
* poll() support
*/
*/
...
@@ -612,7 +612,7 @@ select_poll(PyObject *self, PyObject *args)
...
@@ -612,7 +612,7 @@ select_poll(PyObject *self, PyObject *args)
return
NULL
;
return
NULL
;
return
(
PyObject
*
)
rv
;
return
(
PyObject
*
)
rv
;
}
}
#endif
/* HAVE_POLL */
#endif
/* HAVE_POLL
&& !HAVE_BROKEN_POLL
*/
PyDoc_STRVAR
(
select_doc
,
PyDoc_STRVAR
(
select_doc
,
"select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)
\n
\
"select(rlist, wlist, xlist[, timeout]) -> (rlist, wlist, xlist)
\n
\
...
@@ -639,9 +639,9 @@ On Windows, only sockets are supported; on Unix, all file descriptors.");
...
@@ -639,9 +639,9 @@ On Windows, only sockets are supported; on Unix, all file descriptors.");
static
PyMethodDef
select_methods
[]
=
{
static
PyMethodDef
select_methods
[]
=
{
{
"select"
,
select_select
,
METH_VARARGS
,
select_doc
},
{
"select"
,
select_select
,
METH_VARARGS
,
select_doc
},
#if
def HAVE_POLL
#if
defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
{
"poll"
,
select_poll
,
METH_VARARGS
,
poll_doc
},
{
"poll"
,
select_poll
,
METH_VARARGS
,
poll_doc
},
#endif
/* HAVE_POLL */
#endif
/* HAVE_POLL
&& !HAVE_BROKEN_POLL
*/
{
0
,
0
},
/* sentinel */
{
0
,
0
},
/* sentinel */
};
};
...
@@ -660,7 +660,7 @@ initselect(void)
...
@@ -660,7 +660,7 @@ initselect(void)
SelectError
=
PyErr_NewException
(
"select.error"
,
NULL
,
NULL
);
SelectError
=
PyErr_NewException
(
"select.error"
,
NULL
,
NULL
);
Py_INCREF
(
SelectError
);
Py_INCREF
(
SelectError
);
PyModule_AddObject
(
m
,
"error"
,
SelectError
);
PyModule_AddObject
(
m
,
"error"
,
SelectError
);
#if
def HAVE_POLL
#if
defined(HAVE_POLL) && !defined(HAVE_BROKEN_POLL)
poll_Type
.
ob_type
=
&
PyType_Type
;
poll_Type
.
ob_type
=
&
PyType_Type
;
PyModule_AddIntConstant
(
m
,
"POLLIN"
,
POLLIN
);
PyModule_AddIntConstant
(
m
,
"POLLIN"
,
POLLIN
);
PyModule_AddIntConstant
(
m
,
"POLLPRI"
,
POLLPRI
);
PyModule_AddIntConstant
(
m
,
"POLLPRI"
,
POLLPRI
);
...
@@ -684,5 +684,5 @@ initselect(void)
...
@@ -684,5 +684,5 @@ initselect(void)
#ifdef POLLMSG
#ifdef POLLMSG
PyModule_AddIntConstant
(
m
,
"POLLMSG"
,
POLLMSG
);
PyModule_AddIntConstant
(
m
,
"POLLMSG"
,
POLLMSG
);
#endif
#endif
#endif
/* HAVE_POLL */
#endif
/* HAVE_POLL
&& !HAVE_BROKEN_POLL
*/
}
}
configure
Dosyayı görüntüle @
e62c5c88
#! /bin/sh
#! /bin/sh
# From configure.in Revision: 1.45
1
.
# From configure.in Revision: 1.45
2
.
# Guess values for system-dependent variables and create Makefiles.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.57 for python 2.4.
# Generated by GNU Autoconf 2.57 for python 2.4.
#
#
...
@@ -17577,6 +17577,78 @@ _ACEOF
...
@@ -17577,6 +17577,78 @@ _ACEOF
fi
fi
echo
"
$as_me
:
$LINENO
: checking for broken poll()"
>
&5
echo
$ECHO_N
"checking for broken poll()...
$ECHO_C
"
>
&6
if
test
"
$cross_compiling
"
=
yes
;
then
ac_cv_broken_poll
=
no
else
cat
>
conftest.
$ac_ext
<<
_ACEOF
#line
$LINENO
"configure"
/* confdefs.h. */
_ACEOF
cat
confdefs.h
>>
conftest.
$ac_ext
cat
>>
conftest.
$ac_ext
<<
_ACEOF
/* end confdefs.h. */
#include <poll.h>
int main (void)
{
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
close (42);
int poll_test = poll (&poll_struct, 1, 0);
if (poll_test < 0)
{
exit(0);
}
else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
{
exit(0);
}
else
{
exit(1);
}
}
_ACEOF
rm
-f
conftest
$ac_exeext
if
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_link
\"
"
)
>
&5
(
eval
$ac_link
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
&&
{
ac_try
=
'./conftest$ac_exeext'
{
(
eval echo
"
$as_me
:
$LINENO
:
\"
$ac_try
\"
"
)
>
&5
(
eval
$ac_try
)
2>&5
ac_status
=
$?
echo
"
$as_me
:
$LINENO
:
\$
? =
$ac_status
"
>
&5
(
exit
$ac_status
)
;
}
;
}
;
then
ac_cv_broken_poll
=
yes
else
echo
"
$as_me
: program exited with status
$ac_status
"
>
&5
echo
"
$as_me
: failed program was:"
>
&5
sed
's/^/| /'
conftest.
$ac_ext
>
&5
(
exit
$ac_status
)
ac_cv_broken_poll
=
no
fi
rm
-f
core core.
*
*
.core gmon.out bb.out conftest
$ac_exeext
conftest.
$ac_objext
conftest.
$ac_ext
fi
echo
"
$as_me
:
$LINENO
: result:
$ac_cv_broken_poll
"
>
&5
echo
"
${
ECHO_T
}
$ac_cv_broken_poll
"
>
&6
if
test
"
$ac_cv_broken_poll
"
=
yes
then
cat
>>
confdefs.h
<<
\
_ACEOF
#define HAVE_BROKEN_POLL 1
_ACEOF
fi
# tzset(3) exists and works like we expect it to
# tzset(3) exists and works like we expect it to
echo
"
$as_me
:
$LINENO
: checking for working tzset()"
>
&5
echo
"
$as_me
:
$LINENO
: checking for working tzset()"
>
&5
echo
$ECHO_N
"checking for working tzset()...
$ECHO_C
"
>
&6
echo
$ECHO_N
"checking for working tzset()...
$ECHO_C
"
>
&6
...
...
configure.in
Dosyayı görüntüle @
e62c5c88
...
@@ -2765,6 +2765,43 @@ then
...
@@ -2765,6 +2765,43 @@ then
[Define if nice() returns success/failure instead of the new priority.])
[Define if nice() returns success/failure instead of the new priority.])
fi
fi
AC_MSG_CHECKING(for broken poll())
AC_TRY_RUN([
#include <poll.h>
int main (void)
{
struct pollfd poll_struct = { 42, POLLIN|POLLPRI|POLLOUT, 0 };
close (42);
int poll_test = poll (&poll_struct, 1, 0);
if (poll_test < 0)
{
exit(0);
}
else if (poll_test == 0 && poll_struct.revents != POLLNVAL)
{
exit(0);
}
else
{
exit(1);
}
}
],
ac_cv_broken_poll=yes,
ac_cv_broken_poll=no,
ac_cv_broken_poll=no)
AC_MSG_RESULT($ac_cv_broken_poll)
if test "$ac_cv_broken_poll" = yes
then
AC_DEFINE(HAVE_BROKEN_POLL, 1,
[Define if poll() sets errno on invalid file descriptors.])
fi
# tzset(3) exists and works like we expect it to
# tzset(3) exists and works like we expect it to
AC_MSG_CHECKING(for working tzset())
AC_MSG_CHECKING(for working tzset())
AC_CACHE_VAL(ac_cv_working_tzset, [
AC_CACHE_VAL(ac_cv_working_tzset, [
...
...
pyconfig.h.in
Dosyayı görüntüle @
e62c5c88
...
@@ -46,6 +46,9 @@
...
@@ -46,6 +46,9 @@
/* Define if nice() returns success/failure instead of the new priority. */
/* Define if nice() returns success/failure instead of the new priority. */
#undef HAVE_BROKEN_NICE
#undef HAVE_BROKEN_NICE
/* Define if poll() sets errno on invalid file descriptors. */
#undef HAVE_BROKEN_POLL
/* Define if the Posix semaphores do not work on your system */
/* Define if the Posix semaphores do not work on your system */
#undef HAVE_BROKEN_POSIX_SEMAPHORES
#undef HAVE_BROKEN_POSIX_SEMAPHORES
...
@@ -435,6 +438,12 @@
...
@@ -435,6 +438,12 @@
/* Define to 1 if you have the <stdint.h> header file. */
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strdup' function. */
#undef HAVE_STRDUP
/* Define to 1 if you have the `strerror' function. */
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
#undef HAVE_STRERROR
...
@@ -444,6 +453,9 @@
...
@@ -444,6 +453,9 @@
/* Define to 1 if you have the <strings.h> header file. */
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <stropts.h> header file. */
/* Define to 1 if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
#undef HAVE_STROPTS_H
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment