Lines Matching refs:ifd
334 int ifd = -1; in main() local
387 ifd = open (params.imagefile, O_RDONLY|O_BINARY); in main()
389 ifd = open (params.imagefile, in main()
393 if (ifd < 0) { in main()
404 if (fstat(ifd, &sbuf) < 0) { in main()
418 ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, ifd, 0); in main()
443 (void) close (ifd); in main()
479 if (write(ifd, tparams->hdr, tparams->header_size) in main()
510 if (write(ifd, (char *)&size, sizeof(size)) != sizeof(size)) { in main()
535 copy_file (ifd, file, 1); in main()
539 copy_file (ifd, file, 0); in main()
545 pbl_load_uboot(ifd, ¶ms); in main()
550 ret = zynqmpbif_copy_image(ifd, ¶ms); in main()
557 ret = imx8image_copy_image(ifd, ¶ms); in main()
564 ret = imx8mimage_copy_image(ifd, ¶ms); in main()
572 ret = rockchip_copy_image(ifd, ¶ms); in main()
576 copy_file(ifd, params.datafile, pad_len); in main()
591 if (write(ifd, (char *) &i, 1) != 1) { in main()
600 if (write(ifd, &ivt_header, sizeof(flash_header_v2_t)) in main()
617 (void) fdatasync (ifd); in main()
619 (void) fsync (ifd); in main()
622 if (fstat(ifd, &sbuf) < 0) { in main()
630 ptr = mmap(0, map_len, PROT_READ | PROT_WRITE, MAP_SHARED, ifd, 0); in main()
639 tparams->set_header (ptr, &sbuf, ifd, ¶ms); in main()
662 (void) fdatasync (ifd); in main()
664 (void) fsync (ifd); in main()
667 if (close(ifd)) { in main()
677 copy_file (int ifd, const char *datafile, int pad) in copy_file() argument
743 ret = write(ifd, ptr + offset, size); in copy_file()
758 if (write(ifd, (char *)&zero, 4-tail) != 4-tail) { in copy_file()
770 if (write(ifd, (char *)&zeros, todo) != todo) { in copy_file()