Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 190660a

Browse filesBrowse files
[3.12] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110580)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
1 parent 2fc8081 commit 190660a
Copy full SHA for 190660a

File tree

Expand file treeCollapse file tree

4 files changed

+23
-2
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+23
-2
lines changed

‎Modules/socketmodule.c

Copy file name to clipboardExpand all lines: Modules/socketmodule.c
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5655,8 +5655,9 @@ socket_sethostname(PyObject *self, PyObject *args)
56555655
Py_buffer buf;
56565656
int res, flag = 0;
56575657

5658-
#ifdef _AIX
5659-
/* issue #18259, not declared in any useful header file */
5658+
#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && Py_SUNOS_VERSION <= 510)
5659+
/* issue #18259, sethostname is not declared in any useful header file on AIX
5660+
* the same is true for Solaris 10 */
56605661
extern int sethostname(const char *, size_t);
56615662
#endif
56625663

‎configure

Copy file name to clipboardExpand all lines: configure
+9Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

Copy file name to clipboardExpand all lines: configure.ac
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,14 @@ then
590590
darwin*) MACHDEP="darwin";;
591591
'') MACHDEP="unknown";;
592592
esac
593+
594+
if test "$ac_sys_system" = "SunOS"; then
595+
# For Solaris, there isn't an OS version specific macro defined
596+
# in most compilers, so we define one here.
597+
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
598+
AC_DEFINE_UNQUOTED([Py_SUNOS_VERSION], [$SUNOS_VERSION],
599+
[The version of SunOS/Solaris as reported by `uname -r' without the dot.])
600+
fi
593601
fi
594602
AC_MSG_RESULT(["$MACHDEP"])
595603

‎pyconfig.h.in

Copy file name to clipboardExpand all lines: pyconfig.h.in
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,9 @@
16211621
/* Define if you want to enable internal statistics gathering. */
16221622
#undef Py_STATS
16231623

1624+
/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
1625+
#undef Py_SUNOS_VERSION
1626+
16241627
/* Define if you want to enable tracing references for debugging purpose */
16251628
#undef Py_TRACE_REFS
16261629

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.