/// Write all bytes in the buffer.
Write all bytes in the buffer.
Write all bytes in the buffer .
fn write_all(fd: libc::c_int, buf: &[u8]) {
    let mut bytes_written = 0;
    loop {
        if bytes_written == buf.len() {
            break;
        }
        let num = write_once(fd, &buf[bytes_written..]);
        assert!(num > 0);
        bytes_written += num as usize;
    }
}
fn write_all ( fd : libc :: c_int , buf : & [ u8 ] ) { let mut bytes_written = 0 ; loop { if bytes_written == buf . len ( ) { break ; } let num = write_once ( fd , & buf [ bytes_written .. ] ) ; assert ! ( num 0 ) ; bytes_written += num as usize ; } }
Write all bytes in the buffer.
Write all bytes in the buffer .
fd
libc::c_int
buf
&[u8]