/arch/um/os-Linux/ |
D | file.c | 38 int os_stat_fd(const int fd, struct uml_stat *ubuf) in os_stat_fd() argument 43 CATCH_EINTR(err = fstat64(fd, &sbuf)); in os_stat_fd() 83 int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg) in os_ioctl_generic() argument 87 err = ioctl(fd, cmd, arg); in os_ioctl_generic() 95 int os_get_ifname(int fd, char* namebuf) in os_get_ifname() argument 97 if (ioctl(fd, SIOCGIFNAME, namebuf) < 0) in os_get_ifname() 103 int os_set_slip(int fd) in os_set_slip() argument 108 if (ioctl(fd, TIOCSETD, &disc) < 0) in os_set_slip() 112 if (ioctl(fd, SIOCSIFENCAP, &sencap) < 0) in os_set_slip() 118 int os_mode_fd(int fd, int mode) in os_mode_fd() argument [all …]
|
D | mem.c | 98 int fd; in make_tempfile() local 110 fd = open(tempdir, O_CLOEXEC | O_RDWR | O_EXCL | O_TMPFILE, 0700); in make_tempfile() 115 if (fd != -1 || (errno != EINVAL && errno != EISDIR && in make_tempfile() 117 return fd; in make_tempfile() 126 fd = mkstemp(tempname); in make_tempfile() 127 if (fd < 0) { in make_tempfile() 137 return fd; in make_tempfile() 139 close(fd); in make_tempfile() 149 int fd, err; in create_tmp_file() local 152 fd = make_tempfile(TEMPNAME_TEMPLATE); in create_tmp_file() [all …]
|
D | tty.c | 14 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()
|
D | irq.c | 45 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()
|
D | process.c | 31 int fd, err; in os_process_pc() local 34 fd = open(proc_stat, O_RDONLY, 0); in os_process_pc() 35 if (fd < 0) { in os_process_pc() 40 CATCH_EINTR(err = read(fd, buf, sizeof(buf))); in os_process_pc() 46 os_close_file(fd); in os_process_pc() 54 close(fd); in os_process_pc() 63 int parent = FAILURE_PID, n, fd; in os_process_parent() local 69 fd = open(stat, O_RDONLY, 0); in os_process_parent() 70 if (fd < 0) { in os_process_parent() 76 CATCH_EINTR(n = read(fd, data, sizeof(data))); in os_process_parent() [all …]
|
/arch/um/drivers/ |
D | port_kern.c | 24 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 …]
|
D | chan_user.c | 17 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 …]
|
D | port_user.c | 74 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 …]
|
D | pty.c | 45 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 …]
|
D | fd.c | 16 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()
|
/arch/tile/gxio/ |
D | uart.c | 31 int fd; in gxio_uart_init() local 34 fd = hv_dev_open((HV_VirtAddr) file, 0); in gxio_uart_init() 35 if (fd < 0) { in gxio_uart_init() 36 if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX) in gxio_uart_init() 37 return fd; in gxio_uart_init() 42 context->fd = fd; in gxio_uart_init() 46 iorpc_ioremap(fd, HV_UART_MMIO_OFFSET, HV_UART_MMIO_SIZE); in gxio_uart_init() 49 hv_dev_close(context->fd); in gxio_uart_init() 50 context->fd = -1; in gxio_uart_init() 62 hv_dev_close(context->fd); in gxio_uart_destroy() [all …]
|
D | trio.c | 31 int fd; in gxio_trio_init() local 34 fd = hv_dev_open((HV_VirtAddr) file, 0); in gxio_trio_init() 35 if (fd < 0) { in gxio_trio_init() 36 context->fd = -1; in gxio_trio_init() 38 if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX) in gxio_trio_init() 39 return fd; in gxio_trio_init() 44 context->fd = fd; in gxio_trio_init()
|
D | usb_host.c | 33 int fd; in gxio_usb_host_init() local 42 fd = hv_dev_open((HV_VirtAddr) file, 0); in gxio_usb_host_init() 43 if (fd < 0) { in gxio_usb_host_init() 44 if (fd >= GXIO_ERR_MIN && fd <= GXIO_ERR_MAX) in gxio_usb_host_init() 45 return fd; in gxio_usb_host_init() 50 context->fd = fd; in gxio_usb_host_init() 54 (void __force *)iorpc_ioremap(fd, 0, HV_USB_HOST_MMIO_SIZE); in gxio_usb_host_init() 57 hv_dev_close(context->fd); in gxio_usb_host_init() 69 hv_dev_close(context->fd); in gxio_usb_host_destroy() 72 context->fd = -1; in gxio_usb_host_destroy()
|
/arch/sh/kernel/ |
D | sys_sh32.c | 28 int fd[2]; in sys_sh_pipe() local 31 error = do_pipe_flags(fd, 0); in sys_sh_pipe() 33 current_pt_regs()->regs[1] = fd[1]; in sys_sh_pipe() 34 return fd[0]; in sys_sh_pipe() 39 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, in sys_pread_wrapper() argument 42 return sys_pread64(fd, buf, count, pos); in sys_pread_wrapper() 45 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, in sys_pwrite_wrapper() argument 48 return sys_pwrite64(fd, buf, count, pos); in sys_pwrite_wrapper() 51 asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, in sys_fadvise64_64_wrapper() argument 55 return sys_fadvise64_64(fd, (u64)offset1 << 32 | offset0, in sys_fadvise64_64_wrapper() [all …]
|
D | smp.c | 388 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; in flush_tlb_range_ipi() local 390 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2); in flush_tlb_range_ipi() 400 struct flush_tlb_data fd; in flush_tlb_range() local 402 fd.vma = vma; in flush_tlb_range() 403 fd.addr1 = start; in flush_tlb_range() 404 fd.addr2 = end; in flush_tlb_range() 405 smp_call_function(flush_tlb_range_ipi, (void *)&fd, 1); in flush_tlb_range() 418 struct flush_tlb_data *fd = (struct flush_tlb_data *)info; in flush_tlb_kernel_range_ipi() local 420 local_flush_tlb_kernel_range(fd->addr1, fd->addr2); in flush_tlb_kernel_range_ipi() 425 struct flush_tlb_data fd; in flush_tlb_kernel_range() local [all …]
|
/arch/powerpc/kernel/ |
D | sys_ppc32.c | 66 unsigned long fd, unsigned long pgoff) in compat_sys_mmap2() argument 69 return sys_mmap(addr, len, prot, flags, fd, pgoff << 12); in compat_sys_mmap2() 77 compat_ssize_t compat_sys_pread64(unsigned int fd, char __user *ubuf, compat_size_t count, in compat_sys_pread64() argument 80 return sys_pread64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); in compat_sys_pread64() 83 compat_ssize_t compat_sys_pwrite64(unsigned int fd, const char __user *ubuf, compat_size_t count, in compat_sys_pwrite64() argument 86 return sys_pwrite64(fd, ubuf, count, ((loff_t)poshi << 32) | poslo); in compat_sys_pwrite64() 89 compat_ssize_t compat_sys_readahead(int fd, u32 r4, u32 offhi, u32 offlo, u32 count) in compat_sys_readahead() argument 91 return sys_readahead(fd, ((loff_t)offhi << 32) | offlo, count); in compat_sys_readahead() 100 asmlinkage long compat_sys_fallocate(int fd, int mode, u32 offhi, u32 offlo, in compat_sys_fallocate() argument 103 return sys_fallocate(fd, mode, ((loff_t)offhi << 32) | offlo, in compat_sys_fallocate() [all …]
|
/arch/xtensa/kernel/ |
D | smp.c | 485 struct flush_data *fd = arg; in ipi_flush_tlb_page() local 486 local_flush_tlb_page(fd->vma, fd->addr1); in ipi_flush_tlb_page() 491 struct flush_data fd = { in flush_tlb_page() local 495 on_each_cpu(ipi_flush_tlb_page, &fd, 1); in flush_tlb_page() 500 struct flush_data *fd = arg; in ipi_flush_tlb_range() local 501 local_flush_tlb_range(fd->vma, fd->addr1, fd->addr2); in ipi_flush_tlb_range() 507 struct flush_data fd = { in flush_tlb_range() local 512 on_each_cpu(ipi_flush_tlb_range, &fd, 1); in flush_tlb_range() 517 struct flush_data *fd = arg; in ipi_flush_tlb_kernel_range() local 518 local_flush_tlb_kernel_range(fd->addr1, fd->addr2); in ipi_flush_tlb_kernel_range() [all …]
|
/arch/mips/kernel/ |
D | linux32.c | 65 unsigned long, prot, unsigned long, flags, unsigned long, fd, 70 return sys_mmap_pgoff(addr, len, prot, flags, fd, 88 SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy, 91 return sys_ftruncate(fd, merge_64(a2, a3)); 94 SYSCALL_DEFINE5(32_llseek, unsigned int, fd, unsigned int, offset_high, 98 return sys_llseek(fd, offset_high, offset_low, result, origin); 105 SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count, 108 return sys_pread64(fd, buf, count, merge_64(a4, a5)); 111 SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf, 114 return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); [all …]
|
/arch/um/include/shared/ |
D | os.h | 134 extern int os_stat_fd(const int fd, struct uml_stat *buf); 136 extern int os_set_exec_close(int fd); 137 extern int os_ioctl_generic(int fd, unsigned int cmd, unsigned long arg); 138 extern int os_get_ifname(int fd, char *namebuf); 139 extern int os_set_slip(int fd); 140 extern int os_mode_fd(int fd, int mode); 141 extern int os_fsync_file(int fd); 143 extern int os_seek_file(int fd, unsigned long long offset); 145 extern int os_read_file(int fd, void *buf, int len); 146 extern int os_write_file(int fd, const void *buf, int count); [all …]
|
/arch/um/kernel/ |
D | irq.c | 60 static int activate_fd(int irq, int fd, int type, void *dev_id) in activate_fd() argument 67 err = os_set_fd_async(fd); in activate_fd() 81 .fd = fd, in activate_fd() 90 if ((irq_fd->fd == fd) && (irq_fd->type == type)) { in activate_fd() 91 printk(KERN_ERR "Registering fd %d twice\n", fd); in activate_fd() 100 fd = -1; in activate_fd() 106 n = os_create_pollfd(fd, events, tmp_pfd, n); in activate_fd() 141 maybe_sigio_broken(fd, (type == IRQ_READ)); in activate_fd() 182 static int same_fd(struct irq_fd *irq, void *fd) in same_fd() argument 184 return (irq->fd == *((int *)fd)); in same_fd() [all …]
|
/arch/xtensa/platforms/iss/include/platform/ |
D | simcall.h | 94 static inline int simc_close(int fd) in simc_close() argument 96 return __simc(SYS_close, fd, 0, 0); in simc_close() 99 static inline int simc_ioctl(int fd, int request, void *arg) in simc_ioctl() argument 101 return __simc(SYS_ioctl, fd, request, (int) arg); in simc_ioctl() 104 static inline int simc_read(int fd, void *buf, size_t count) in simc_read() argument 106 return __simc(SYS_read, fd, (int) buf, count); in simc_read() 109 static inline int simc_write(int fd, const void *buf, size_t count) in simc_write() argument 111 return __simc(SYS_write, fd, (int) buf, count); in simc_write() 114 static inline int simc_poll(int fd) in simc_poll() argument 118 return __simc(SYS_select_one, fd, XTISS_SELECT_ONE_READ, (int)&tv); in simc_poll() [all …]
|
/arch/tile/kernel/ |
D | compat.c | 48 COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy, in COMPAT_SYSCALL_DEFINE4() argument 51 return sys_ftruncate(fd, ((loff_t)length_hi << 32) | length_lo); in COMPAT_SYSCALL_DEFINE4() 54 COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf, in COMPAT_SYSCALL_DEFINE6() argument 57 return sys_pread64(fd, ubuf, count, in COMPAT_SYSCALL_DEFINE6() 61 COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf, in COMPAT_SYSCALL_DEFINE6() argument 64 return sys_pwrite64(fd, ubuf, count, in COMPAT_SYSCALL_DEFINE6() 68 COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, in COMPAT_SYSCALL_DEFINE6() argument 71 return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, in COMPAT_SYSCALL_DEFINE6() 76 COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, in COMPAT_SYSCALL_DEFINE6() argument 79 return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, in COMPAT_SYSCALL_DEFINE6() [all …]
|
/arch/x86/ia32/ |
D | sys_ia32.c | 61 asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long offset_low, in sys32_ftruncate64() argument 64 return sys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low); in sys32_ftruncate64() 120 asmlinkage long sys32_fstat64(unsigned int fd, struct stat64 __user *statbuf) in sys32_fstat64() argument 123 int ret = vfs_fstat(fd, &stat); in sys32_fstat64() 152 unsigned int fd; member 166 return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, in sys32_mmap() 177 asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, in sys32_pread() argument 180 return sys_pread64(fd, ubuf, count, in sys32_pread() 184 asmlinkage long sys32_pwrite(unsigned int fd, const char __user *ubuf, in sys32_pwrite() argument 187 return sys_pwrite64(fd, ubuf, count, in sys32_pwrite() [all …]
|
/arch/powerpc/platforms/cell/spufs/ |
D | coredump.c | 73 static int match_context(const void *v, struct file *file, unsigned fd) in match_context() argument 81 return fd + 1; in match_context() 96 static struct spu_context *coredump_next_context(int *fd) in coredump_next_context() argument 99 int n = iterate_fd(current->files, *fd, match_context, NULL); in coredump_next_context() 102 *fd = n - 1; in coredump_next_context() 103 file = fcheck(*fd); in coredump_next_context() 110 int size = 0, rc, fd; in spufs_coredump_extra_notes_size() local 112 fd = 0; in spufs_coredump_extra_notes_size() 113 while ((ctx = coredump_next_context(&fd)) != NULL) { in spufs_coredump_extra_notes_size() 117 rc = spufs_ctx_note_size(ctx, fd); in spufs_coredump_extra_notes_size() [all …]
|
/arch/metag/kernel/ |
D | sys_metag.c | 43 unsigned long fd, unsigned long pgoff) in sys_mmap2() argument 51 return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); in sys_mmap2() 114 asmlinkage long sys_ftruncate64_metag(unsigned int fd, unsigned long lo, in sys_ftruncate64_metag() argument 117 return sys_ftruncate64(fd, merge_64(hi, lo)); in sys_ftruncate64_metag() 120 asmlinkage long sys_fadvise64_64_metag(int fd, unsigned long offs_lo, in sys_fadvise64_64_metag() argument 125 return sys_fadvise64_64(fd, merge_64(offs_hi, offs_lo), in sys_fadvise64_64_metag() 129 asmlinkage long sys_readahead_metag(int fd, unsigned long lo, unsigned long hi, in sys_readahead_metag() argument 132 return sys_readahead(fd, merge_64(hi, lo), count); in sys_readahead_metag() 135 asmlinkage ssize_t sys_pread64_metag(unsigned long fd, char __user *buf, in sys_pread64_metag() argument 139 return sys_pread64(fd, buf, count, merge_64(hi, lo)); in sys_pread64_metag() [all …]
|