Lines Matching defs:fd
338 int msg = 0, fd;
340 if ((fd = open(fname, O_RDONLY)) == -1) {
349 if (fstat(fd, &sbuf) == -1)
355 if (read(fd, buf, sz) != sz)
359 (void) close(fd);
361 if ((fd = open(fname, O_WRONLY | O_TRUNC)) == -1)
385 if (write(fd, &buf[mark], i - mark) != i - mark)
405 if (write(fd, &buf[mark], sz - mark) != sz - mark)
409 (void) close(fd);
454 int fd;
457 if ((fd = open(fname, O_RDONLY)) == -1)
460 if (fstat(fd, &sbuf) == -1)
466 if (read(fd, buf, sz) != sz)
470 (void) close(fd);
501 if ((fd = open(tmpname,
505 if (write(fd, buf, strlen(buf)) < strlen(buf)) {
510 (void) close(fd);
1466 int fd;
1471 if ((fd = open64(g_argv[i], O_RDONLY)) == -1)
1474 if ((elf = elf_begin(fd, ELF_C_READ, NULL)) == NULL) {
1475 (void) close(fd);
1481 (void) close(fd);
1486 (void) close(fd);