Lines Matching refs:fd
215 loadfile(int fd, char *args, int isupgrade)
232 if ((rval = read(fd, &hdr, sizeof(hdr))) != sizeof(hdr)) {
246 rval = elf64_exec(fd, &hdr.elf64, &entry, &ssym, &esym);
261 if (fstat(fd, &st) == 0) {
263 if (fchmod(fd, st.st_mode) == -1)
267 close(fd);
278 close(fd);
300 int fd, error = 0;
302 fd = open(path, O_RDONLY);
303 if (fd == -1)
305 if (fstat(fd, &sb) == -1) {
309 if (read(fd, buf, buflen) != buflen) {
318 fchmod(fd, sb.st_mode | S_ISTXT);
320 close(fd);
433 int fd;
523 if ((fd = open(bootline, O_RDONLY)) < 0) {
530 printf("main: Calling loadfile(fd, %s)\n", opened_name);
532 (void)loadfile(fd, opened_name, isupgrade);