Skip to content

Commit 0c3aaad

Browse files
vstinnerkulikjak
andcommitted
gh-63760: Don't declare gethostname() on Solaris
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>
1 parent d4e534c commit 0c3aaad

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix Solaris build: no longer redefine the ``gethostname()`` function. Solaris
2+
defines the function since 2005. Patch by Victor Stinner, original patch by
3+
Jakub Kulík.

Modules/socketmodule.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ Local naming conventions:
111111
#include "pycore_fileutils.h" // _Py_set_inheritable()
112112
#include "pycore_moduleobject.h" // _PyModule_GetState
113113

114-
// gethostname() prototype missing from Solaris standard header files
115-
#ifdef __sun
116-
extern int gethostname(char *, int);
117-
#endif
118-
119114
#ifdef _Py_MEMORY_SANITIZER
120115
# include <sanitizer/msan_interface.h>
121116
#endif

0 commit comments

Comments
 (0)