Skip to content

Commit

Permalink
[3.12] gh-63760: Don't declare gethostname() on Solaris (#108817) (#1…
Browse files Browse the repository at this point in the history
…08824)

gh-63760: Don't declare gethostname() on Solaris (#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

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
(cherry picked from commit 0e6d582)
  • Loading branch information
vstinner authored Sep 2, 2023
1 parent c5ce34f commit 7269916
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,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 <sys/types.h> /* we need to import mode_t */
extern char * _getpty(int *, int, mode_t, int);
Expand Down
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 7269916

Please sign in to comment.