paravirtualization/encryption/client.c
ssize_t insist_read(int fd, void *buf, size_t cnt)
{
    ssize_t ret;
    size_t orig_cnt = cnt;

    while (cnt > 0) {
        ret = read(fd, buf, cnt);
        if (ret < 0)
            return ret;
        buf += ret;
        cnt -= ret;
    }

    return orig_cnt;
}
/* Insist until all of the data has been read */
Insist until all of the data has been read
Insist until all of the data has been read
ssize_t insist_read(int fd, void *buf, size_t cnt)
{
    ssize_t ret;
    size_t orig_cnt = cnt;
    while (cnt > 0) {
        ret = read(fd, buf, cnt);
        if (ret < 0)
            return ret;
        buf += ret;
        cnt -= ret;
    }
    return orig_cnt;
}
ssize_t insist_read ( int fd , void * buf , size_t cnt ) { ssize_t ret ; size_t orig_cnt = cnt ; while ( cnt > 0 ) { ret = read ( fd , buf , cnt ) ; if ( ret < 0 ) return ret ; buf += ret ; cnt -= ret ; } return orig_cnt ; }
Insist until all of the data has been read
Insist until all of the data has been read