Skip to content

Commit a04a52a

Browse files
committed
Auto merge of rust-lang#279 - kamalmarhubi:pipe_buf, r=alexcrichton
unix: Add PIPE_BUF for bsd and notbsd This is the maximum size of guaranteed-atomic writes to a pipe.
2 parents 4fc03fe + ce0dc73 commit a04a52a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/unix/bsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
298298
pub const LOG_FTP: ::c_int = 11 << 3;
299299
pub const LOG_PERROR: ::c_int = 0x20;
300300

301+
pub const PIPE_BUF: usize = 512;
302+
301303
f! {
302304
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
303305
let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8;

src/unix/notbsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ pub const LOG_AUTHPRIV: ::c_int = 10 << 3;
650650
pub const LOG_FTP: ::c_int = 11 << 3;
651651
pub const LOG_PERROR: ::c_int = 0x20;
652652

653+
pub const PIPE_BUF: usize = 4096;
654+
653655
f! {
654656
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
655657
let fd = fd as usize;

0 commit comments

Comments
 (0)