Skip to content

Commit

Permalink
pythongh-63760: Don't declare gethostname() on Solaris
Browse files Browse the repository at this point in the history
Since at least 2013, Oracle 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>
  • Loading branch information
vstinner and kulikjak committed Sep 2, 2023
1 parent e7de0c5 commit b83c531
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
@@ -0,0 +1,3 @@
Fix Solaris build: no longer redefine the ``gethostname()`` function. Oracle
Solaris defines the function since at least 2013. Patch by Victor Stinner,
original patch by Jakub Kulík.
5 changes: 0 additions & 5 deletions Modules/socketmodule.c
Expand Up @@ -111,11 +111,6 @@ Local naming conventions:
#include "pycore_fileutils.h" // _Py_set_inheritable()
#include "pycore_moduleobject.h" // _PyModule_GetState

// gethostname() prototype missing from Solaris standard header files
#ifdef __sun
extern int gethostname(char *, int);
#endif

#ifdef _Py_MEMORY_SANITIZER
# include <sanitizer/msan_interface.h>
#endif
Expand Down

0 comments on commit b83c531

Please sign in to comment.