-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
listen does not allow specifying a negative backlog #2264
Comments
See rust-lang/rust#97963 for a discussion of the behavior on Linux. |
So we know that on FreeBSD, a negative backlog or a value bigger than the max one means the default value. And from that PR, Linux will see Maybe we should use a wrapper type, just like the one introduced in #1876 |
Ok, from the Linux source code, they directly cast the
|
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1, SOMAXCONN to 511. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1/0, to SOMAXCONN. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1/0, to SOMAXCONN. close nix-rustgh-2264
changing the sys::socket::listen backlog type from `usize` to a `i32` wrapper, offering known sane values, from -1/0, to SOMAXCONN. close gh-2264
Note: openbsd could eventually be added in some months or later. |
The
listen
function, in C, takes a "backlog" argument as anint
. It normally must be positive. However, it may be ngative:But when
listen
was added to Nix in change f85e9bf , the backlog argument's type was specified asusize
, which precludes negative values. It also will rollover ati32::MAX_VALUE
with unpredictable consequences.The text was updated successfully, but these errors were encountered: