Lines Matching defs:fd
396 int fd;
405 { "fd", NV_INTEGER|NV_RDONLY, offsetof(struct filedata,fd), sizeof(int)},
437 "\avar\a\b.fd\b is the file descriptor.]"
498 int fd = -1;
572 fd = sh_open(argv[1], oflag, mode);
573 if(fd<0)
577 fcntl(fd, F_SETFL, 0);
584 fstat(fd, &fdp->statb);
585 fdp->fd = fd;
595 "[+DESCRIPTION?\bclose\b closes the file descriptor specified by fd.]"
609 int fd = -1;
626 fd = strtol(argv[0], (char **)NULL, 0);
627 if (errno != 0 || fd < 0)
630 n = sh_close(fd);
669 int ffd, fd = -1;
694 fd = sh_dup(ffd);
695 if(fd<0)
700 fcntl(fd, F_SETFL, 0);
708 fstat(fd, &fdp->statb);
709 fdp->fd = fd;
721 "fd: same open file (or pipe), same file pointer (that is, both file descriptors "
727 "\nvar fd\n"
744 int ffd, fd = -1;
768 errormsg(SH_DICT, ERROR_system(1), "%s: invalid fd", argv[1]);
770 fd = sh_dup(ffd);
771 if(fd<0)
775 fcntl(fd,F_SETFL,0);
783 fstat(fd, &fdp->statb);
784 fdp->fd = fd;
855 fdp->fd = -1;
866 "[+DESCRIPTION?The \brewind\b command will move the file pointer of fd to position 0.]"
881 int fd = -1;
898 fd = strtol(argv[0], (char **)NULL, 0);
899 if (errno != 0 || fd < 0)
900 errormsg(SH_DICT, ERROR_system(1), "%s: invalid fd", argv[0]);
902 if (sh_seek(fd, 0, SEEK_SET) == (off_t)-1)