Page MenuHomeFreeBSD

Improve POSIX compliance of listen()
Needs ReviewPublic

Authored by tuexen on Sep 3 2021, 11:55 AM.

Details

Reviewers
markj
rscheff
Summary

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

Repository
R10 FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

tuexen created this revision.

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.

Document the code change in the man-page

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.

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.