Lines Matching refs:fd
156 kwboot_tty_recv(int fd, void *buf, size_t len, int timeo) in kwboot_tty_recv() argument
166 FD_SET(fd, &rfds); in kwboot_tty_recv()
176 nfds = select(fd + 1, &rfds, NULL, NULL, &tv); in kwboot_tty_recv()
184 n = read(fd, buf, len); in kwboot_tty_recv()
198 kwboot_tty_send(int fd, const void *buf, size_t len) in kwboot_tty_send() argument
209 n = write(fd, buf, len); in kwboot_tty_send()
217 rc = tcdrain(fd); in kwboot_tty_send()
223 kwboot_tty_send_char(int fd, unsigned char c) in kwboot_tty_send_char() argument
225 return kwboot_tty_send(fd, &c, 1); in kwboot_tty_send_char()
250 int rc, fd; in kwboot_open_tty() local
255 fd = open(path, O_RDWR|O_NOCTTY|O_NDELAY); in kwboot_open_tty()
256 if (fd < 0) in kwboot_open_tty()
270 rc = tcsetattr(fd, TCSANOW, &tio); in kwboot_open_tty()
274 rc = fd; in kwboot_open_tty()
277 if (fd >= 0) in kwboot_open_tty()
278 close(fd); in kwboot_open_tty()
372 kwboot_xm_sendblock(int fd, struct kwboot_block *block) in kwboot_xm_sendblock() argument
379 rc = kwboot_tty_send(fd, block, sizeof(*block)); in kwboot_xm_sendblock()
384 rc = kwboot_tty_recv(fd, &c, 1, blk_rsp_timeo); in kwboot_xm_sendblock()
569 int rc, fd, flags; in kwboot_mmap_image() local
576 fd = open(path, O_RDONLY); in kwboot_mmap_image()
577 if (fd < 0) in kwboot_mmap_image()
580 rc = fstat(fd, &st); in kwboot_mmap_image()
586 img = mmap(NULL, st.st_size, prot, flags, fd, 0); in kwboot_mmap_image()
599 if (fd >= 0) in kwboot_mmap_image()
600 close(fd); in kwboot_mmap_image()