Lines Matching defs:prep_fd
168 prep_check_mbr(int prep_fd, char *rawdev)
181 lseek(prep_fd, sizeof(mbr), SEEK_SET);
182 write(prep_fd, &entry, sizeof(entry));
183 write(prep_fd, &length, sizeof(length));
219 lseek(prep_fd, 0, SEEK_SET);
222 write(prep_fd, mbr, sizeof(mbr));
223 write(prep_fd, &entry, sizeof(entry));
224 write(prep_fd, &length, sizeof(length));
281 write(prep_fd, mbr, sizeof(mbr));
282 write(prep_fd, &entry, sizeof(entry));
283 write(prep_fd, &length, sizeof(length));
291 int elf_fd, prep_fd, kern_fd, elf_img_len = 0;
323 if ((prep_fd = open(outname, O_RDWR|O_TRUNC, 0)) < 0) {
325 prep_fd = creat(outname, 0644);
326 if (prep_fd < 0)
331 prep_check_mbr(prep_fd, rawdev);
334 lseek(prep_fd, 0x400, SEEK_SET);
343 write(prep_fd, elf_img, elf_img_len);
361 gzf = gzdopen(dup(prep_fd), "a");
368 write(prep_fd, (void *)prep_magic, PREP_MAGICSIZE);
369 lenpos = lseek(prep_fd, 0, SEEK_CUR);
371 write(prep_fd, (void *)&tmp, KERNLENSIZE);
374 kstart = lseek(prep_fd, 0, SEEK_CUR);
379 kend = lseek(prep_fd, 0, SEEK_CUR);
382 lseek(prep_fd, lenpos, SEEK_SET);
385 write(prep_fd, (void *)&tmp, KERNLENSIZE);
388 lseek(prep_fd, sizeof(mbr) + 4, SEEK_SET);
389 write(prep_fd, &length, sizeof(length));
405 close(prep_fd);