summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-10-10 10:06:18 (GMT)
committerGitHub <noreply@github.com>2023-10-10 10:06:18 (GMT)
commit194272179dc2cbe67358fc0ebde73dea90bc5a1b (patch)
treec43fc87d178ae9df880d41bd856a3cdfd944e5e1 /Modules/socketmodule.c
parent2b3a4182798bc95a426e55d1f9f7199e2f2b5662 (diff)
downloadcpython-194272179dc2cbe67358fc0ebde73dea90bc5a1b.zip
cpython-194272179dc2cbe67358fc0ebde73dea90bc5a1b.tar.gz
cpython-194272179dc2cbe67358fc0ebde73dea90bc5a1b.tar.bz2
[3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110581)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580af07c0ce90d1c2073ab087772283d7e3b9) Co-authored-by: Jakub KulĂ­k <Kulikjak@gmail.com>
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index db3e051..8d9d3c3 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -5534,8 +5534,9 @@ socket_sethostname(PyObject *self, PyObject *args)
Py_buffer buf;
int res, flag = 0;
-#ifdef _AIX
-/* issue #18259, not declared in any useful header file */
+#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && Py_SUNOS_VERSION <= 510)
+/* issue #18259, sethostname is not declared in any useful header file on AIX
+ * the same is true for Solaris 10 */
extern int sethostname(const char *, size_t);
#endif