Skip to content

proposal: net: export listenerBacklog #67990

@database64128

Description

@database64128

Proposal Details

The listenerBacklog function returns a cached value of the optimal maximum permitted listener backlog on the current system, obtained in platform-specific ways. This is useful for user code that makes direct listen(2) syscalls and then calls net.FileListener to create a net.Listener.

Since the function signature is unlikely to change in the future, and we already had it exempted from the linkname restriction, I propose we add:

// MaxListenerBacklog returns the maximum permitted listener backlog value on the current system.
// The return value may be used as the backlog argument to the listen(2) syscall.
func MaxListenerBacklog() int

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Incoming

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions