Skip to content

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commented Sep 1, 2023

Move prototypes of gethostname(), _getpty() and struct termios from pyport.h to the C code using them: posixmodule.c, socketmodule.c and termios.c.

Replace "#ifdef SOLARIS" with "#ifdef __sun".

Move prototypes of gethostname(), _getpty() and struct termios from pyport.h to the C code using them: posixmodule.c, socketmodule.c and termios.c. Replace "#ifdef SOLARIS" with "#ifdef __sun".
@vstinner
Copy link
MemberAuthor

Buildbots are happy with this change: #108784

@vstinnervstinner merged commit 1f3e797 into python:mainSep 2, 2023
@vstinnervstinner deleted the prototypes branch September 2, 2023 13:46
@vstinner
Copy link
MemberAuthor

@kulikjak: It would be nice if you can double check the Solaris change:

Replace "#ifdef SOLARIS" with "#ifdef __sun". 

@kulikjak
Copy link
Contributor

Hi @vstinner, can you, please, remove this part completely? There is already and issue and PR for this that is forgotten a little:
#63760
#23208

As mentioned there, gethostname() is defined now and both Oracle Solaris and OpenSolaris forks remove it:
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

As for the define guard, if defined(__sun) && defined(__SVR4) is the best way to detect Solaris. (Although I guess there isn't that many people running 30+ years old pre SRV4 SunOS systems and building latest Python :))

@kulikjak
Copy link
Contributor

I just realized that it's merged already - I rebased that older PR to remove it.
#23208

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@vstinner@kulikjak@bedevere-bot