We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Client::new
PIPE_BUF
1 parent 210170b commit 466b694Copy full SHA for 466b694
src/unix.rs
@@ -1,4 +1,5 @@
1
-use libc::c_int;
+use libc::{c_int, PIPE_BUF};
2
+
3
use std::fs::File;
4
use std::io::{self, Read, Write};
5
use std::mem;
@@ -22,7 +23,7 @@ pub struct Acquired {
22
23
24
impl Client {
25
pub fn new(mut limit: usize) -> io::Result<Client> {
- if limit > 4096 {
26
+ if limit > PIPE_BUF {
27
return Err(io::Error::new(io::ErrorKind::Other, "Can't have limit larger than 4096 since the pipe would block forever when writing to it"));
28
}
29
0 commit comments