/// Read from the fd until an EOF.
Read from the fd until an EOF.
Read from the fd until an EOF .
fn read_all(fd: libc::c_int) -> Vec<u8> {
    let mut buf = vec![];
    loop {
        let mut tmp_buf = [0u8; 1024];
        let num = read_once(fd, &mut tmp_buf);
        if num == 0 {
            break;
        }
        assert!(num > 0);
        buf.extend_from_slice(&tmp_buf[..(num as usize)]);
    }
    buf
}
fn read_all ( fd : libc :: c_int ) -> Vec < u8 > { let mut buf = vec ! [ ] ; loop { let mut tmp_buf = [ 0u8 ; 1024 ] ; let num = read_once ( fd , & mut tmp_buf ) ; if num == 0 { break ; } assert ! ( num 0 ) ; buf . extend_from_slice ( & tmp_buf [ .. ( num as usize ) ] ) ; } buf }
Read from the fd until an EOF.
Read from the fd until an EOF .
fd
libc::c_int