POSIX states:
If listen() is called with a backlog argument value that is less than 0, the function behaves as if it had been called with a backlog argument value of 0.
This patch ensures that a negative backlog argument is handle as it if was 0.
Differential D31821
Improve POSIX compliance of listen() tuexen on Sep 3 2021, 11:55 AM. Authored by Tags None Referenced Files
Subscribers
Details
POSIX states: If listen() is called with a backlog argument value that is less than 0, the function behaves as if it had been called with a backlog argument value of 0. This patch ensures that a negative backlog argument is handle as it if was 0.
Diff Detail
Event TimelineComment Actions I think I'm ok with the change, but IMO listen.2 should also document our behaviour for the cases backlog < 0, backlog == 0, backlog > 0. Comment Actions I added text to the listen.2, which documents the code change. Or are you referring to also document the semantic of backlog for the SCTP case? This is missing, but not related to the code change in this patch. Comment Actions Please note such things: https://github.com/php/php-src/blob/master/sapi/fpm/www.conf.in#L39 I think it may be quite popular listen() usage and, even if we patch and recompile new software, this patch may break a lot of legacy jails with somethng like COMPAT_FREEBSD9. Comment Actions Thanks! There is already a discussion on the commit mailing list... Wanted to provide a link, but discussion starters removed the public list from Cc :( The change is already backed out. Comment Actions 4.2BSD established the backlog == -1 convention, and that convention was never changed in BSD. |