Skip to content

Conversation

@vstinner
Copy link
Member Author

vstinner commented Sep 2, 2023

@kulikjak: Would you mind to review my PR? (And test it if possible?)

I saw your PR #23208, but I tried to add more documentation about the change from the issue and your latest comments.

I plan to backport the change manually to Python 3.12 (the function was defined in pyport.h), and then to 3.11.

@kulikjak
Copy link
Contributor

kulikjak commented Sep 2, 2023

@vstinner, I tried running tests but sadly the build failed due to what seems like unrelated issue:

/builds/cpython-main/Modules/termios.c: In function 'termios_tcgetwinsize_impl':
/builds/cpython-main/Modules/termios.c:389:9: error: implicit declaration of function 'ioctl' [-Werror=implicit-function-declaration]
389 |     r = ioctl(fd, TIOCGWINSZ, &w);
    |         ^~~~~
/builds/cpython-main/Modules/_multiprocessing/multiprocessing.c: In function 'multiprocessing_exec':
/builds/cpython-main/Modules/_multiprocessing/multiprocessing.h:44:32: error: implicit declaration of function 'sysconf'; did you mean '_sysconf'? [-Werror=implicit-function-declaration]
44 |         # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX)
   |                                ^~~~~

but I don't see how this change can break anything as it's how we compile Python for many years now.

Just two minor nits for the NEWS fragment - it's at least since 2005 (when Solaris was opened) and it's not just Oracle Solaris but Solaris in general.

@vstinner
Copy link
Member Author

vstinner commented Sep 2, 2023

/builds/cpython-main/Modules/_multiprocessing/multiprocessing.c: In function 'multiprocessing_exec':
/builds/cpython-main/Modules/_multiprocessing/multiprocessing.h:44:32: error: implicit declaration of function 'sysconf'; did you mean '_sysconf'? [-Werror=implicit-function-declaration]
44 |         # define SEM_VALUE_MAX sysconf(_SC_SEM_VALUE_MAX)
   |                                ^~~~~

I wrote PR #108823 to fix warning.

For Modules/termios.c, I don't know which include is missing on Solaris to get ioctl(). Is it also unistd.h? On Linux, man ioctl asks to #include <sys/ioctl.h>.

@vstinner vstinner force-pushed the socket_solaris_gethostname branch from b83c531 to 0c3aaad Compare September 2, 2023 17:16
@vstinner
Copy link
Member Author

vstinner commented Sep 2, 2023

Just two minor nits for the NEWS fragment - it's at least since 2005 (when Solaris was opened) and it's not just Oracle Solaris but Solaris in general.

Ok, I updated the PR. Would you mind to review it again?

Copy link
Contributor

@kulikjak kulikjak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vstinner vstinner enabled auto-merge (squash) September 2, 2023 17:24
@kulikjak
Copy link
Contributor

kulikjak commented Sep 2, 2023

For Modules/termios.c, I don't know which include is missing on Solaris to get ioctl(). Is it also unistd.h? On Linux, man ioctl asks to #include <sys/ioctl.h>.

Yes, I needed to add unistd.h there for build to pass. With #108823 there seems to be no issues anymore. Thanks!

@vstinner vstinner merged commit 0e6d582 into python:main Sep 2, 2023
@vstinner vstinner deleted the socket_solaris_gethostname branch September 2, 2023 17:55
@bedevere-bot
Copy link

GH-108824 is a backport of this pull request to the 3.12 branch.

@vstinner
Copy link
Member Author

vstinner commented Sep 2, 2023

Yes, I needed to add unistd.h there for build to pass. With #108823 there seems to be no issues anymore. Thanks!

Please create a PR for Modules/termios.c.

@kulikjak
Copy link
Contributor

kulikjak commented Sep 2, 2023

I created #108825 to fix it.

vstinner added a commit that referenced this pull request Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants