Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 170) sorted by relevance

1234567

/arch/um/os-Linux/
Dmem.c61 static int next(int fd, char *buf, size_t size, char c) in next() argument
68 n = read(fd, buf, size - 1); in next()
85 n = read(fd, &buf[len], size - len - 1); in next()
109 int fd, found; in which_tmpdir() local
119 fd = open("/proc/mounts", O_RDONLY); in which_tmpdir()
120 if (fd < 0) { in which_tmpdir()
126 found = next(fd, buf, ARRAY_SIZE(buf), ' '); in which_tmpdir()
133 found = next(fd, buf, ARRAY_SIZE(buf), '\n'); in which_tmpdir()
145 close(fd); in which_tmpdir()
150 found = next(fd, buf, ARRAY_SIZE(buf), ' '); in which_tmpdir()
[all …]
Dfile.c36 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument
41 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd()
81 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument
85 err = ioctl(fd, cmd, arg); in os_ioctl_generic()
93 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument
95 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname()
101 int os_set_slip(int fd) in os_set_slip() argument
106 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip()
110 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip()
116 int os_mode_fd(int fd, int mode) in os_mode_fd() argument
[all …]
Dtty.c14 int fd; member
23 info->res = grantpt(info->fd); in grantpt_cb()
30 int fd, err; in get_pty() local
32 fd = open("/dev/ptmx", O_RDWR); in get_pty()
33 if (fd < 0) { in get_pty()
40 info.fd = fd; in get_pty()
50 if (unlockpt(fd) < 0) { in get_pty()
56 return fd; in get_pty()
58 close(fd); in get_pty()
Dirq.c45 pollfds[i].fd = -1; in os_waiting_for_events()
52 int os_create_pollfd(int fd, int events, void *tmp_pfd, int size_tmpfds) in os_create_pollfd() argument
71 pollfds[pollfds_num] = ((struct pollfd) { .fd = fd, in os_create_pollfd()
89 if ((pollfds[i].fd != -1) && in os_free_irq_by_cb()
90 (pollfds[i].fd != (*prev)->fd)) { in os_free_irq_by_cb()
94 (*prev)->fd, pollfds[i].fd); in os_free_irq_by_cb()
111 ignore_sigio_fd(old_fd->fd); in os_free_irq_by_cb()
124 return pollfds[i].fd; in os_get_pollfd()
127 void os_set_pollfd(int i, int fd) in os_set_pollfd() argument
129 pollfds[i].fd = fd; in os_set_pollfd()
Dprocess.c30 int fd, err; in os_process_pc() local
33 fd = open(proc_stat, O_RDONLY, 0); in os_process_pc()
34 if (fd < 0) { in os_process_pc()
39 CATCH_EINTR(err = read(fd, buf, sizeof(buf))); in os_process_pc()
45 os_close_file(fd); in os_process_pc()
53 close(fd); in os_process_pc()
62 int parent = FAILURE_PID, n, fd; in os_process_parent() local
68 fd = open(stat, O_RDONLY, 0); in os_process_parent()
69 if (fd < 0) { in os_process_parent()
75 CATCH_EINTR(n = read(fd, data, sizeof(data))); in os_process_parent()
[all …]
/arch/um/drivers/
Dport_kern.c24 int fd; member
38 int fd; member
48 int fd; in pipe_interrupt() local
50 fd = os_rcv_fd(conn->socket[0], &conn->helper_pid); in pipe_interrupt()
51 if (fd < 0) { in pipe_interrupt()
52 if (fd == -EAGAIN) in pipe_interrupt()
56 -fd); in pipe_interrupt()
57 os_close_file(conn->fd); in pipe_interrupt()
62 conn->fd = fd; in pipe_interrupt()
79 int fd, socket[2], pid; in port_accept() local
[all …]
Dchan_user.c17 void generic_close(int fd, void *unused) in generic_close() argument
19 close(fd); in generic_close()
22 int generic_read(int fd, char *c_out, void *unused) in generic_read() argument
26 n = read(fd, c_out, sizeof(*c_out)); in generic_read()
38 int generic_write(int fd, const char *buf, int n, void *unused) in generic_write() argument
42 err = write(fd, buf, n); in generic_write()
52 int generic_window_size(int fd, void *unused, unsigned short *rows_out, in generic_window_size() argument
58 if (ioctl(fd, TIOCGWINSZ, &size) < 0) in generic_window_size()
74 int generic_console_write(int fd, const char *buf, int n) in generic_console_write() argument
80 if (isatty(fd)) { in generic_console_write()
[all …]
Dport_user.c74 int fd, err; in port_open() local
76 fd = port_wait(data->kernel_data); in port_open()
77 if ((fd >= 0) && data->raw) { in port_open()
78 CATCH_EINTR(err = tcgetattr(fd, &data->tt)); in port_open()
82 err = raw(fd); in port_open()
87 return fd; in port_open()
90 static void port_close(int fd, void *d) in port_close() argument
95 os_close_file(fd); in port_close()
114 int fd, err, arg; in port_listen_fd() local
116 fd = socket(PF_INET, SOCK_STREAM, 0); in port_listen_fd()
[all …]
Dpty.c45 int fd, err; in pts_open() local
47 fd = get_pty(); in pts_open()
48 if (fd < 0) { in pts_open()
55 CATCH_EINTR(err = tcgetattr(fd, &data->tt)); in pts_open()
59 err = raw(fd); in pts_open()
64 dev = ptsname(fd); in pts_open()
71 return fd; in pts_open()
74 close(fd); in pts_open()
117 int fd, err; in pty_open() local
120 fd = getmaster(dev); in pty_open()
[all …]
Dfd.c16 int fd; member
45 *data = ((struct fd_chan) { .fd = n, in fd_init()
55 if (data->raw && isatty(data->fd)) { in fd_open()
56 CATCH_EINTR(err = tcgetattr(data->fd, &data->tt)); in fd_open()
60 err = raw(data->fd); in fd_open()
64 sprintf(data->str, "%d", data->fd); in fd_open()
66 return data->fd; in fd_open()
69 static void fd_close(int fd, void *d) in fd_close() argument
74 if (!data->raw || !isatty(fd)) in fd_close()
77 CATCH_EINTR(err = tcsetattr(fd, TCSAFLUSH, &data->tt)); in fd_close()
Dchan_user.h33 extern void generic_close(int fd, void *unused);
34 extern int generic_read(int fd, char *c_out, void *unused);
35 extern int generic_write(int fd, const char *buf, int n, void *unused);
36 extern int generic_console_write(int fd, const char *buf, int n);
37 extern int generic_window_size(int fd, void *unused, unsigned short *rows_out,
42 extern void register_winch(int fd, struct tty_struct *tty);
43 extern void register_winch_irq(int fd, int tty_fd, int pid,
Dumcast_user.c70 int fd, yes = 1, err = -EINVAL; in umcast_open() local
78 fd = socket(AF_INET, SOCK_DGRAM, 0); in umcast_open()
80 if (fd < 0) { in umcast_open()
87 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) { in umcast_open()
96 if (setsockopt(fd, SOL_IP, IP_MULTICAST_TTL, &pri->ttl, in umcast_open()
105 if (setsockopt(fd, SOL_IP, IP_MULTICAST_LOOP, in umcast_open()
115 if (bind(fd, (struct sockaddr *) lsin, sizeof(*lsin)) < 0) { in umcast_open()
126 if (setsockopt(fd, SOL_IP, IP_ADD_MEMBERSHIP, in umcast_open()
140 return fd; in umcast_open()
143 close(fd); in umcast_open()
[all …]
Dxterm.c88 int pid, fd, new, err; in xterm_open() local
112 fd = mkstemp(file); in xterm_open()
113 if (fd < 0) { in xterm_open()
124 close(fd); in xterm_open()
127 close(fd); in xterm_open()
129 fd = os_create_unix_socket(file, sizeof(file), 1); in xterm_open()
130 if (fd < 0) { in xterm_open()
132 "errno = %d\n", -fd); in xterm_open()
133 return fd; in xterm_open()
145 err = os_set_fd_block(fd, 0); in xterm_open()
[all …]
Dxterm_kern.c15 int fd; member
23 int fd; in xterm_interrupt() local
25 fd = os_rcv_fd(xterm->fd, &xterm->pid); in xterm_interrupt()
26 if (fd == -EAGAIN) in xterm_interrupt()
29 xterm->new_fd = fd; in xterm_interrupt()
47 *data = ((struct xterm_wait) { .fd = socket, in xterm_fd()
/arch/um/kernel/
Dirq.c63 static int activate_fd(int irq, int fd, int type, void *dev_id) in activate_fd() argument
70 err = os_set_fd_async(fd); in activate_fd()
84 .fd = fd, in activate_fd()
93 if ((irq_fd->fd == fd) && (irq_fd->type == type)) { in activate_fd()
94 printk(KERN_ERR "Registering fd %d twice\n", fd); in activate_fd()
103 fd = -1; in activate_fd()
109 n = os_create_pollfd(fd, events, tmp_pfd, n); in activate_fd()
144 maybe_sigio_broken(fd, (type == IRQ_READ)); in activate_fd()
185 static int same_fd(struct irq_fd *irq, void *fd) in same_fd() argument
187 return (irq->fd == *((int *)fd)); in same_fd()
[all …]
/arch/sh/kernel/
Dsys_sh32.c29 int fd[2]; in sys_sh_pipe() local
32 error = do_pipe_flags(fd, 0); in sys_sh_pipe()
34 regs->regs[1] = fd[1]; in sys_sh_pipe()
35 return fd[0]; in sys_sh_pipe()
40 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, in sys_pread_wrapper() argument
43 return sys_pread64(fd, buf, count, pos); in sys_pread_wrapper()
46 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, in sys_pwrite_wrapper() argument
49 return sys_pwrite64(fd, buf, count, pos); in sys_pwrite_wrapper()
52 asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, in sys_fadvise64_64_wrapper() argument
56 return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0, in sys_fadvise64_64_wrapper()
[all …]
Dsmp.c400 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; in flush_tlb_range_ipi() local
402 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2); in flush_tlb_range_ipi()
412 struct flush_tlb_data fd; in flush_tlb_range() local
414 fd.vma = vma; in flush_tlb_range()
415 fd.addr1 = start; in flush_tlb_range()
416 fd.addr2 = end; in flush_tlb_range()
417 smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1); in flush_tlb_range()
430 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; in flush_tlb_kernel_range_ipi() local
432 local_flush_tlb_kernel_range(fd->addr1, fd->addr2); in flush_tlb_kernel_range_ipi()
437 struct flush_tlb_data fd; in flush_tlb_kernel_range() local
[all …]
/arch/um/include/shared/
Dos.h132 extern int os_stat_fd(const int fd, struct uml_stat *buf);
134 extern int os_set_exec_close(int fd);
135 extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg);
136 extern int os_get_ifname(int fd, char *namebuf);
137 extern int os_set_slip(int fd);
138 extern int os_mode_fd(int fd, int mode);
140 extern int os_seek_file(int fd, unsigned long long offset);
142 extern int os_read_file(int fd, void *buf, int len);
143 extern int os_write_file(int fd, const void *buf, int count);
146 extern int os_pipe(int *fd, int stream, int close_on_exec);
[all …]
Dirq_user.h14 int fd; member
24 extern void free_irq_by_fd(int fd);
25 extern void reactivate_fd(int fd, int irqnum);
26 extern void deactivate_fd(int fd, int irqnum);
28 extern int activate_ipi(int fd, int pid);
/arch/parisc/kernel/
Dsys_parisc.c116 unsigned long prot, unsigned long flags, unsigned long fd, in sys_mmap2() argument
121 return sys_mmap_pgoff(addr, len, prot, flags, fd, in sys_mmap2()
126 unsigned long prot, unsigned long flags, unsigned long fd, in sys_mmap() argument
130 return sys_mmap_pgoff(addr, len, prot, flags, fd, in sys_mmap()
146 asmlinkage long parisc_ftruncate64(unsigned int fd, in parisc_ftruncate64() argument
149 return sys_ftruncate(fd, (long)high << 32 | low); in parisc_ftruncate64()
158 asmlinkage long sys_ftruncate64(unsigned int fd, unsigned long length) in sys_ftruncate64() argument
160 return sys_ftruncate(fd, length); in sys_ftruncate64()
162 asmlinkage long sys_fcntl64(unsigned int fd, unsigned int cmd, unsigned long arg) in sys_fcntl64() argument
164 return sys_fcntl(fd, cmd, arg); in sys_fcntl64()
[all …]
/arch/mips/pmc-sierra/yosemite/
Datmel_read_eeprom.h58 #define vcc_off (ioctl(fd, TIOCSBRK, 0))
59 #define vcc_on (ioctl(fd, TIOCCBRK, 0))
60 #define sda_hi (ioctl(fd, TIOCMBIS, &dtr))
61 #define sda_lo (ioctl(fd, TIOCMBIC, &dtr))
62 #define scl_lo (ioctl(fd, TIOCMBIC, &rts))
63 #define scl_hi (ioctl(fd, TIOCMBIS, &rts))
67 int fd; variable
/arch/parisc/hpux/
Dioctl.c43 static int hpux_ioctl_t(int fd, unsigned long cmd, unsigned long arg) in hpux_ioctl_t() argument
49 result = sys_ioctl(fd, TIOCSWINSZ, arg); in hpux_ioctl_t()
52 result = sys_ioctl(fd, TIOCGWINSZ, arg); in hpux_ioctl_t()
58 int hpux_ioctl(int fd, unsigned long cmd, unsigned long arg) in hpux_ioctl() argument
65 result = sys_ioctl(fd, cmd, arg); in hpux_ioctl()
68 result = hpux_ioctl_t(fd, cmd, arg); in hpux_ioctl()
/arch/s390/kernel/
Dsys_s390.c46 unsigned long fd; member
57 error = sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset); in SYSCALL_DEFINE1()
101 SYSCALL_DEFINE5(s390_fadvise64, int, fd, u32, offset_high, u32, offset_low, in SYSCALL_DEFINE5() argument
104 return sys_fadvise64(fd, (u64) offset_high << 32 | offset_low, in SYSCALL_DEFINE5()
109 int fd; member
121 return sys_fadvise64_64(a.fd, a.offset, a.len, a.advice); in SYSCALL_DEFINE1()
136 SYSCALL_DEFINE(s390_fallocate)(int fd, int mode, loff_t offset, in SYSCALL_DEFINE()
139 return sys_fallocate(fd, mode, offset, ((u64)len_high << 32) | len_low); in SYSCALL_DEFINE()
142 asmlinkage long SyS_s390_fallocate(long fd, long mode, loff_t offset, in SyS_s390_fallocate() argument
145 return SYSC_s390_fallocate((int) fd, (int) mode, offset, in SyS_s390_fallocate()
/arch/mips/include/asm/
Dpmon.h34 #define pmon_close(fd) debug_vectors->close(fd) argument
35 #define pmon_read(fd, buf, count) debug_vectors->read(fd, buf, count) argument
36 #define pmon_write(fd, buf, count) debug_vectors->write(fd, buf, count) argument
37 #define pmon_lseek(fd, off, whence) debug_vectors->lseek(fd, off, whence) argument
/arch/tile/kernel/
Dsys.c54 ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count) in sys32_readahead() argument
56 return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); in sys32_readahead()
59 int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi, in sys32_fadvise64_64() argument
62 return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, in sys32_fadvise64_64()
71 unsigned long, fd, unsigned long, off_4k) in SYSCALL_DEFINE6() argument
76 return sys_mmap_pgoff(addr, len, prot, flags, fd, in SYSCALL_DEFINE6()
83 unsigned long, fd, off_t, offset) in SYSCALL_DEFINE6() argument
87 return sys_mmap_pgoff(addr, len, prot, flags, fd, in SYSCALL_DEFINE6()

1234567