openssh-portable icon indicating copy to clipboard operation
openssh-portable copied to clipboard

Avoid assuming layout of fd_set

Open CendioOssman opened this issue 3 years ago • 1 comments

POSIX doesn't specify the internal layout of the fd_set object, so let's not assume it is just a bit mask. This increases compatibility with systems that have a different layout.

The assumption is also worthless as we already refuse to use file descriptors over FD_SETSIZE anyway. Meaning that the default size of fd_set is quite sufficient.

CendioOssman avatar Jul 06 '22 14:07 CendioOssman

The failing tests don't look like it comes from this change, so hopefully that's not a blocker?

CendioOssman avatar Jul 08 '22 13:07 CendioOssman

Change looks reasonable. On what platforms are fd_sets not bit vectors?

The failing tests don't look like it comes from this change, so hopefully that's not a blocker?

They were indeed unrelated and is not a blocker. (They can get broken by several dependencies as well as us, and some of the tests are inherently racy. After some recent infrastructure work they are all green and hopefully should be a bit less flaky.)

daztucker avatar Nov 08 '22 21:11 daztucker

Applied, thanks.

daztucker avatar Nov 08 '22 22:11 daztucker

We needed this for our port to Windows. So not one of the officially supported platforms. I haven't checked if any Unix dialect also needs this.

CendioOssman avatar Nov 09 '22 08:11 CendioOssman