Skip to content

Commit 0e6d582

Browse files
vstinnerkulikjak
andauthored
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 <[email protected]>
1 parent bac1e6d commit 0e6d582

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
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

-5
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)