Skip to content
Snippets Groups Projects
Commit 3d23700c authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

osutil: disable compilation of recvfds() on unsupported platforms

It appears that Solaris doesn't provide CMSG_LEN(), msg_control, etc. As
recvfds() is only necessary for chg, this patch just drops it if CMSG_LEN
isn't defined, which is the same workaround as Python 3.x.

https://hg.python.org/cpython/rev/c64216addd7f#l7.33
parent 5907ed2b
No related branches found
No related tags found
No related merge requests found
......@@ -653,4 +653,7 @@
/*
* recvfds() simply does not release GIL during blocking io operation because
* command server is known to be single-threaded.
*
* Old systems such as Solaris don't provide CMSG_LEN, msg_control, etc.
* Currently, recvfds() is not supported on these platforms.
*/
......@@ -656,4 +659,5 @@
*/
#ifdef CMSG_LEN
static ssize_t recvfdstobuf(int sockfd, int **rfds, void *cbuf, size_t cbufsize)
{
......@@ -713,6 +717,7 @@
return NULL;
}
#endif /* CMSG_LEN */
#endif /* ndef _WIN32 */
static PyObject *listdir(PyObject *self, PyObject *args, PyObject *kwargs)
......@@ -881,6 +886,7 @@
{"statfiles", (PyCFunction)statfiles, METH_VARARGS | METH_KEYWORDS,
"stat a series of files or symlinks\n"
"Returns None for non-existent entries and entries of other types.\n"},
#ifdef CMSG_LEN
{"recvfds", (PyCFunction)recvfds, METH_VARARGS,
"receive list of file descriptors via socket\n"},
#endif
......@@ -884,6 +890,7 @@
{"recvfds", (PyCFunction)recvfds, METH_VARARGS,
"receive list of file descriptors via socket\n"},
#endif
#endif
#ifdef __APPLE__
{
"isgui", (PyCFunction)isgui, METH_NOARGS,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment