Lines Matching refs:fd

35 ssize_t os_read(int fd, void *buf, size_t count)  in os_read()  argument
37 return read(fd, buf, count); in os_read()
40 ssize_t os_read_no_block(int fd, void *buf, size_t count) in os_read_no_block() argument
42 const int flags = fcntl(fd, F_GETFL, 0); in os_read_no_block()
44 fcntl(fd, F_SETFL, flags | O_NONBLOCK); in os_read_no_block()
45 return os_read(fd, buf, count); in os_read_no_block()
48 ssize_t os_write(int fd, const void *buf, size_t count) in os_write() argument
50 return write(fd, buf, count); in os_write()
53 off_t os_lseek(int fd, off_t offset, int whence) in os_lseek() argument
63 return lseek(fd, offset, whence); in os_lseek()
91 int os_close(int fd) in os_close() argument
93 return close(fd); in os_close()
119 void os_tty_raw(int fd, bool allow_sigs) in os_tty_raw() argument
127 if (tcgetattr(fd, &orig_term)) in os_tty_raw()
135 if (tcsetattr(fd, TCSANOW, &term)) in os_tty_raw()
419 int fd, ret; in os_write_ram_buf() local
421 fd = open(fname, O_CREAT | O_WRONLY, 0777); in os_write_ram_buf()
422 if (fd < 0) in os_write_ram_buf()
424 ret = write(fd, state->ram_buf, state->ram_size); in os_write_ram_buf()
425 close(fd); in os_write_ram_buf()
435 int fd, ret; in os_read_ram_buf() local
443 fd = open(fname, O_RDONLY); in os_read_ram_buf()
444 if (fd < 0) in os_read_ram_buf()
447 ret = read(fd, state->ram_buf, state->ram_size); in os_read_ram_buf()
448 close(fd); in os_read_ram_buf()
457 int fd; in make_exec() local
460 fd = mkstemp(fname); in make_exec()
461 if (fd < 0) in make_exec()
463 if (write(fd, data, size) < 0) in make_exec()
465 close(fd); in make_exec()
497 int fd, err; in os_jump_to_image() local
509 fd = mkstemp(mem_fname); in os_jump_to_image()
510 if (fd < 0) in os_jump_to_image()
512 close(fd); in os_jump_to_image()
551 int fd; in os_find_u_boot() local
560 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
561 if (fd >= 0) { in os_find_u_boot()
562 close(fd); in os_find_u_boot()
571 fd = os_open(fname, O_RDONLY); in os_find_u_boot()
572 if (fd >= 0) { in os_find_u_boot()
573 close(fd); in os_find_u_boot()