Lines Matching refs:IO
72 static void getfdtype(IO *);
73 static void redup_clean_fd(IO *);
77 IO in, out; /* input/output state */
317 getfdtype(IO *io)
322 if (io->ops->op_fstat(io->fd, &sb)) {
323 err(EXIT_FAILURE, "%s", io->name);
327 io->flags |= io->ops->op_ioctl(io->fd, MTIOCGET, &mt)
329 else if (io->ops->op_lseek(io->fd, (off_t)0, SEEK_CUR) == -1
331 io->flags |= ISPIPE; /* XXX fixed in 4.4BSD */
341 redup_clean_fd(IO *io)
343 int fd = io->fd;
355 newfd = io->ops->op_fcntl(fd, F_DUPFD, 3);
357 err(EXIT_FAILURE, "dupfd IO");
361 io->ops->op_close(fd);
362 io->fd = newfd;
619 bwrite(IO *io, const void *buf, size_t len)
626 rv = io->ops->op_write(io->fd, buf, len);