Lines Matching refs:fb
571 read_whole_file(const char *file, int fd, struct buf *fb, int *with_mmap) in read_whole_file() argument
596 fb->sz = (size_t)st.st_size; in read_whole_file()
597 fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0); in read_whole_file()
598 if (fb->buf != MAP_FAILED) in read_whole_file()
610 fb->sz = 0; in read_whole_file()
611 fb->buf = NULL; in read_whole_file()
613 if (off == fb->sz) { in read_whole_file()
614 if (fb->sz == (1U << 31)) { in read_whole_file()
618 resize_buf(fb, 65536); in read_whole_file()
620 ssz = read(fd, fb->buf + (int)off, fb->sz - off); in read_whole_file()
622 fb->sz = off; in read_whole_file()
632 free(fb->buf); in read_whole_file()
633 fb->buf = NULL; in read_whole_file()