Jakub Kulik <kulik...@gmail.com> added the comment:

I think this code should be removed.

It was added in its current form more than 20 years ago with the intention to 
add function declarations missing from system include files:
https://github.com/python/cpython/commit/1e0c2f4bee43728930bd5f4dc77283f09c4ba004

Today, every Solaris system should have gethostname() available in unistd.h. I 
am not sure when exactly was it added, but it was available in the OpenSolaris 
since the first commit (year 2005):
https://github.com/illumos/illumos-gate/blame/master/usr/src/head/unistd.h#L344


Also, AFAIK, 'SOLARIS' macro is not predefined on Solaris systems in compiler 
preprocessors today *; hence, unless compiled with `-DSOLARIS`, this code has 
no effect.

*) I tested this with several GCC [7|9|10] and Solaris studio and neither of 
those defined it. It seems like it might have worked many years ago, but it 
certainly isn't a way to #ifdef Solaris today.

----------
nosy: +kulikjak

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue19561>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to