Skip to content

Commit 4ef1f7f

Browse files
committed
unix: Add PIPE_BUF for bsd and notbsd
This is the maximum size of guaranteed-atomic writes to a pipe.
1 parent ac75250 commit 4ef1f7f

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
@@ -293,6 +293,8 @@ pub const WNOHANG: ::c_int = 1;
293293
pub const RTLD_NOW: ::c_int = 0x2;
294294
pub const RTLD_DEFAULT: *mut ::c_void = -2isize as *mut ::c_void;
295295

296+
pub const PIPE_BUF: usize = 512;
297+
296298
f! {
297299
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
298300
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
@@ -645,6 +645,8 @@ pub const POSIX_FADV_NOREUSE: ::c_int = 5;
645645
pub const AT_FDCWD: ::c_int = -100;
646646
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x100;
647647

648+
pub const PIPE_BUF: usize = 4096;
649+
648650
f! {
649651
pub fn FD_CLR(fd: ::c_int, set: *mut fd_set) -> () {
650652
let fd = fd as usize;

0 commit comments

Comments
 (0)