From 44fd7870a2ad3f8360ad54facd496fe77c956719 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 2 Sep 2023 23:47:25 +0200 Subject: [PATCH] [3.12] gh-63760: Don't declare gethostname() on Solaris (GH-108817) (GH-108824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gh-63760: Don't declare gethostname() on Solaris (GH-108817) Since 2005, Solaris defines gethostname(). socketmodule.c no longer has to define gethostname() for Solaris. Oracle Solaris and OpenSolaris have patches to remove the gethostname() definition in Python: * https://github.com/oracle/solaris-userland/blob/master/components/python/python37/patches/15-gethostname.patch * https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/python/python37/patches/15-gethostname.patch * https://github.com/omniosorg/omnios-build/blob/master/build/python27/patches/24-gethostname.patch (cherry picked from commit 7269916cd7b89b5e6f20bfe83ebe1038bda56b4b) Co-authored-by: Victor Stinner Co-authored-by: Jakub Kulík (cherry picked from commit 0e6d582b3b73a88e71cae04327b31a1ee203722c) --- Include/pyport.h | 5 ----- .../next/Build/2023-09-02-18-04-15.gh-issue-63760.r8hJ6q.rst | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2023-09-02-18-04-15.gh-issue-63760.r8hJ6q.rst diff --git a/Include/pyport.h b/Include/pyport.h index 93250f4eb1d7a2..b3b8b6f09af3f0 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -439,11 +439,6 @@ Please be conservative with adding new ones, document them and enclose them in platform-specific #ifdefs. **************************************************************************/ -#ifdef SOLARIS -/* Unchecked */ -extern int gethostname(char *, int); -#endif - #ifdef HAVE__GETPTY #include /* we need to import mode_t */ extern char * _getpty(int *, int, mode_t, int); diff --git a/Misc/NEWS.d/next/Build/2023-09-02-18-04-15.gh-issue-63760.r8hJ6q.rst b/Misc/NEWS.d/next/Build/2023-09-02-18-04-15.gh-issue-63760.r8hJ6q.rst new file mode 100644 index 00000000000000..9a7249e923e0c7 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2023-09-02-18-04-15.gh-issue-63760.r8hJ6q.rst @@ -0,0 +1,3 @@ +Fix Solaris build: no longer redefine the ``gethostname()`` function. Solaris +defines the function since 2005. Patch by Victor Stinner, original patch by +Jakub Kulík.