Lines Matching refs:fd
102 file_zmagic(struct magic_set *ms, int fd, const char *name, in file_zmagic() argument
120 (nsz = uncompressbuf(ms, fd, i, buf, &newbuf, in file_zmagic()
154 swrite(int fd, const void *buf, size_t n) in swrite() argument
160 switch (rv = write(fd, buf, n)) { in swrite()
179 sread(int fd, void *buf, size_t n, int canbepipe) in sread() argument
187 if (fd == STDIN_FILENO) in sread()
191 if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) { in sread()
200 FD_SET(fd, &check); in sread()
206 selrv = select(fd + 1, &check, NULL, NULL, &tout); in sread()
216 (void)ioctl(fd, FIONREAD, &t); in sread()
227 switch ((rv = FINFO_READ_FUNC(fd, buf, n))) { in sread()
244 file_pipe2file(struct magic_set *ms, int fd, const void *startbuf, in file_pipe2file() argument
278 while ((r = sread(fd, buf, sizeof(buf), 1)) > 0) in file_pipe2file()
299 if ((fd = dup2(tfd, fd)) == -1) { in file_pipe2file()
304 if (FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) { in file_pipe2file()
308 return fd; in file_pipe2file()
386 uncompressbuf(struct magic_set *ms, int fd, size_t method, in uncompressbuf() argument
401 if ((fd != -1 && pipe(fdin) == -1) || pipe(fdout) == -1) { in uncompressbuf()
408 if (fd != -1) { in uncompressbuf()
409 (void) dup(fd); in uncompressbuf()
440 if (fd == -1) { in uncompressbuf()