Searched refs:fd (Results 76 - 100 of 1421) sorted by relevance

1234567891011>>

/linux-master/tools/lib/perf/
H A Dlib.c10 static ssize_t ion(bool is_read, int fd, void *buf, size_t n) argument
17 ssize_t ret = is_read ? read(fd, buf, left) :
18 write(fd, buf, left);
36 ssize_t readn(int fd, void *buf, size_t n) argument
38 return ion(true, fd, buf, n);
41 ssize_t preadn(int fd, void *buf, size_t n, off_t offs) argument
46 ssize_t ret = pread(fd, buf, left, offs);
64 ssize_t writen(int fd, const void *buf, size_t n) argument
67 return ion(false, fd, (void *)buf, n);
/linux-master/arch/um/drivers/
H A Dharddog.h7 int ping_watchdog(int fd);
H A Dslirp.h30 extern int slirp_user_read(int fd, void *buf, int len, struct slirp_data *pri);
31 extern int slirp_user_write(int fd, void *buf, int len,
H A Dslip.h18 extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri);
19 extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
/linux-master/tools/perf/util/
H A Dperf_api_probe.c19 int err = -EAGAIN, fd; local
32 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1, flags);
33 if (fd < 0) {
42 close(fd);
46 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1, flags);
47 if (fd < 0) {
52 close(fd);
141 int fd; local
150 fd = sys_perf_event_open(&attr, -1, cpu.cpu, -1, 0);
151 if (fd <
173 int fd; local
[all...]
/linux-master/tools/testing/selftests/mm/
H A Dgup_longterm.c38 static __fsword_t get_fs_type(int fd) argument
44 ret = fstatfs(fd, &fs);
91 static void do_test(int fd, size_t size, enum test_type type, bool shared) argument
93 __fsword_t fs_type = get_fs_type(fd);
98 if (ftruncate(fd, size)) {
103 if (fallocate(fd, 0, 0, size)) {
112 shared ? MAP_SHARED : MAP_PRIVATE, fd, 0);
242 typedef void (*test_fn)(int fd, size_t size);
246 int fd; local
250 fd
263 int fd; local
287 int fd; local
311 int fd; local
333 test_shared_rw_pin(int fd, size_t size) argument
338 test_shared_rw_fast_pin(int fd, size_t size) argument
343 test_shared_ro_pin(int fd, size_t size) argument
348 test_shared_ro_fast_pin(int fd, size_t size) argument
353 test_private_rw_pin(int fd, size_t size) argument
358 test_private_rw_fast_pin(int fd, size_t size) argument
363 test_private_ro_pin(int fd, size_t size) argument
368 test_private_ro_fast_pin(int fd, size_t size) argument
374 test_shared_iouring(int fd, size_t size) argument
379 test_private_iouring(int fd, size_t size) argument
[all...]
H A Dhugetlb-read-hwpoison.c70 static bool seek_read_hugepage_filemap(int fd, size_t len, size_t wr_chunk_size, argument
81 if (lseek(fd, offset, SEEK_SET) < 0) {
87 ret_count = read(fd, buf, wr_chunk_size);
107 static bool read_hugepage_filemap(int fd, size_t len, argument
118 ret_count = read(fd, buf, wr_chunk_size);
139 test_hugetlb_read(int fd, size_t len, size_t wr_chunk_size) argument
144 if (ftruncate(fd, len) < 0) {
150 MAP_SHARED | MAP_POPULATE, fd, 0);
159 if (read_hugepage_filemap(fd, len, wr_chunk_size, len))
164 if (ftruncate(fd,
173 test_hugetlb_read_hwpoison(int fd, size_t len, size_t wr_chunk_size, bool skip_hwpoison_page) argument
240 int fd; local
266 int fd; local
[all...]
H A Dcompaction_test.c60 int fd; local
62 fd = open("/proc/sys/vm/compact_unevictable_allowed",
64 if (fd < 0) {
70 if (read(fd, &allowed, sizeof(char)) != sizeof(char)) {
73 close(fd);
77 close(fd);
89 int fd, ret = -1; local
100 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
101 if (fd < 0) {
110 if (write(fd, "10000
162 int fd, ret = -1; local
[all...]
H A Dhugepage-vmemmap.c52 int fd; local
55 fd = open("/proc/self/pagemap", O_RDONLY);
56 if (fd < 0)
59 lseek(fd, (unsigned long)addr / pagesize * sizeof(pagemap), SEEK_SET);
60 read(fd, &pagemap, sizeof(pagemap));
61 close(fd);
68 int fd, i; local
71 fd = open("/proc/kpageflags", O_RDONLY);
72 if (fd < 0)
75 lseek(fd, pf
[all...]
/linux-master/samples/bpf/
H A Dfds_example.c80 int fd, ret; local
83 fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, NULL, sizeof(uint32_t),
85 printf("bpf: map fd:%d (%s)\n", fd, strerror(errno));
86 assert(fd > 0);
88 ret = bpf_obj_pin(fd, file);
92 fd = bpf_obj_get(file);
93 printf("bpf: get fd:%d (%s)\n", fd, strerror(errno));
94 assert(fd >
114 int fd, sock, ret; local
[all...]
/linux-master/drivers/scsi/
H A Dfdomain.c123 static inline void fdomain_make_bus_idle(struct fdomain *fd) argument
125 outb(0, fd->base + REG_BCTL);
126 outb(0, fd->base + REG_MCTL);
127 if (fd->chip == tmc18c50 || fd->chip == tmc18c30)
130 fd->base + REG_ACTL);
132 outb(ACTL_RESET | PARITY_MASK, fd->base + REG_ACTL);
186 struct fdomain *fd = shost_priv(sh); local
188 outb(BCTL_BUSEN | BCTL_SEL, fd->base + REG_BCTL);
189 outb(BIT(sh->this_id) | BIT(target), fd
210 fdomain_finish_cmd(struct fdomain *fd) argument
220 struct fdomain *fd = shost_priv(cmd->device->host); local
240 struct fdomain *fd = shost_priv(cmd->device->host); local
267 struct fdomain *fd = container_of(work, struct fdomain, work); local
388 struct fdomain *fd = dev_id; local
408 struct fdomain *fd = shost_priv(cmd->device->host); local
441 struct fdomain *fd = shost_priv(sh); local
462 struct fdomain *fd = shost_priv(sh); local
518 struct fdomain *fd; local
582 struct fdomain *fd = shost_priv(sh); local
596 struct fdomain *fd = shost_priv(dev_get_drvdata(dev)); local
[all...]
/linux-master/tools/testing/selftests/rtc/
H A Drtctest.c29 int fd; local
33 self->fd = open(rtc_file, O_RDONLY);
37 close(self->fd);
44 if (self->fd == -1 && errno == ENOENT)
46 ASSERT_NE(-1, self->fd);
49 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm);
91 if (self->fd == -1 && errno == ENOENT)
93 ASSERT_NE(-1, self->fd);
98 rc = ioctl(self->fd, RTC_RD_TIME, &rtc_tm);
106 rc = ioctl(self->fd, RTC_RD_TIM
[all...]
/linux-master/tools/lib/api/fd/
H A Darray.c76 int fdarray__add(struct fdarray *fda, int fd, short revents, enum fdarray_flags flags) argument
84 fda->entries[fda->nr].fd = fd;
101 npos = fdarray__add(fda, entry->fd, entry->events, from->priv[pos].flags);
109 void (*entry_destructor)(struct fdarray *fda, int fd, void *arg),
112 int fd, nr = 0; local
117 for (fd = 0; fd < fda->nr; ++fd) {
118 if (!fda->entries[fd]
108 fdarray__filter(struct fdarray *fda, short revents, void (*entry_destructor)(struct fdarray *fda, int fd, void *arg), void *arg) argument
143 int fd, printed = fprintf(fp, "%d [ ", fda->nr); local
[all...]
/linux-master/arch/um/os-Linux/
H A Dmem.c122 int fd; local
134 fd = open(tempdir, O_CLOEXEC | O_RDWR | O_EXCL | O_TMPFILE, 0700);
139 if (fd != -1 || (errno != EINVAL && errno != EISDIR &&
141 return fd;
150 fd = mkstemp(tempname);
151 if (fd < 0) {
161 return fd;
163 close(fd);
173 int fd, err; local
176 fd
202 int err, fd; local
217 int err, fd = create_tmp_file(UM_KERN_PAGE_SIZE); local
[all...]
/linux-master/tools/testing/selftests/net/
H A Dip_local_port_range.c34 static int get_so_domain(int fd) argument
40 err = getsockopt(fd, SOL_SOCKET, SO_DOMAIN, &domain, &len);
47 static int bind_to_loopback_any_port(int fd) argument
57 switch (get_so_domain(fd)) {
74 return bind(fd, &addr.sa, addr_len);
77 static int get_sock_port(int fd) argument
89 err = getsockname(fd, &addr.sa, &addr_len);
104 static int get_ip_local_port_range(int fd, __u32 *range) argument
111 err = getsockopt(fd, SOL_IP, IP_LOCAL_PORT_RANGE, &val, &len);
188 int fd, er local
237 int fd, err, port; local
280 int fd, err, port; local
307 int i, fd, err; local
364 int fd, err; local
421 int fd, err; local
[all...]
/linux-master/tools/testing/selftests/kvm/
H A Dguest_memfd_test.c23 static void test_file_read_write(int fd) argument
27 TEST_ASSERT(read(fd, buf, sizeof(buf)) < 0,
28 "read on a guest_mem fd should fail");
29 TEST_ASSERT(write(fd, buf, sizeof(buf)) < 0,
30 "write on a guest_mem fd should fail");
31 TEST_ASSERT(pread(fd, buf, sizeof(buf), 0) < 0,
32 "pread on a guest_mem fd should fail");
33 TEST_ASSERT(pwrite(fd, buf, sizeof(buf), 0) < 0,
34 "pwrite on a guest_mem fd should fail");
37 static void test_mmap(int fd, size_ argument
45 test_file_size(int fd, size_t page_size, size_t total_size) argument
56 test_fallocate(int fd, size_t page_size, size_t total_size) argument
93 test_invalid_punch_hole(int fd, size_t page_size, size_t total_size) argument
128 int fd; local
177 int fd; local
[all...]
/linux-master/drivers/usb/gadget/
H A Dfunctions.c14 struct usb_function_driver *fd; local
19 list_for_each_entry(fd, &func_list, list) {
21 if (strcmp(name, fd->name))
24 if (!try_module_get(fd->mod)) {
28 fi = fd->alloc_inst();
30 module_put(fd->mod);
32 fi->fd = fd;
61 f = fi->fd->alloc_func(fi);
76 mod = fi->fd
93 struct usb_function_driver *fd; local
111 usb_function_unregister(struct usb_function_driver *fd) argument
[all...]
/linux-master/tools/testing/selftests/proc/
H A Dread.c41 int fd; local
45 fd = openat(dirfd(d), filename, O_RDONLY|O_NONBLOCK);
46 if (fd == -1)
49 (void)lseek(fd, 0, SEEK_SET);
50 rv = read(fd, buf, sizeof(buf));
52 close(fd);
57 int fd; local
60 fd = openat(dirfd(d), filename, O_WRONLY);
61 if (fd == -1)
63 rv = write(fd, bu
95 int fd; local
[all...]
H A Dfd-003-kthread.c16 // Test that /proc/$KERNEL_THREAD/fd/ is empty.
37 * Return /proc/$PID/fd descriptor if process is kernel thread.
44 int dir_fd, fd; local
56 fd = openat(dir_fd, "stat", O_RDONLY);
57 if (fd == -1) {
61 rv = read(fd, buf, sizeof(buf));
62 close(fd);
88 fd = -1;
90 fd = openat(dir_fd, "fd", O_RDONL
96 test_readdir(int fd) argument
122 test_lookup_fail(int fd, const char *pathname) argument
131 test_lookup(int fd) argument
158 int fd; local
[all...]
/linux-master/tools/testing/selftests/bpf/
H A Dtest_maps.c40 int fd; local
42 fd = bpf_map_create(BPF_MAP_TYPE_HASH, NULL, sizeof(key), sizeof(value), 2, &map_opts);
43 if (fd < 0) {
51 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0);
55 assert(bpf_map_update_elem(fd, &key, &value, BPF_NOEXIST) < 0 &&
60 assert(bpf_map_update_elem(fd, &key, &value, -1) < 0 &&
64 assert(bpf_map_lookup_elem(fd, &key, &value) == 0 && value == 1234);
69 assert(bpf_map_update_elem(fd, &key, &value, BPF_ANY) == 0);
72 assert(bpf_map_lookup_and_delete_elem(fd, &key, &value) == 0 && value == 1234);
75 assert(bpf_map_lookup_elem(fd,
135 int fd, i, j; local
158 int fd, i; local
270 int i, fd, ret; local
292 int fd, i, max_entries = 10000; local
363 int key, next_key, fd; local
419 int key, next_key, fd, i; local
482 int key, fd, i; local
513 int fd; local
527 int fd; local
543 int fd, i; local
599 int fd, i; local
664 int err, i, fd, udp, sfd[6] = {0xdeadbeef}; local
1156 int mim_fd, fd, err; local
1316 int fd, i, value; local
1448 int fd = ((int *)data)[0]; local
1478 int i, fd, key = 0, value = 0, j = 0; local
1536 int fd, key = 0, value = 0; local
1565 int fd, key = 0, value = 0; local
1593 int fd, value = 0; local
1729 int fd; local
[all...]
/linux-master/include/linux/
H A Dfdtable.h21 * The default fd array needs to be at least BITS_PER_LONG,
29 struct file __rcu **fd; /* current fd array */ member in struct:fdtable
71 * The caller must ensure that fd table isn't shared or hold rcu or file lock
73 static inline struct file *files_lookup_fd_raw(struct files_struct *files, unsigned int fd) argument
76 unsigned long mask = array_index_mask_nospec(fd, fdt->max_fds);
80 * 'mask' is zero for an out-of-bounds fd, all ones for ok.
81 * 'fd&mask' is 'fd' for ok, or 0 for out of bounds.
83 * Accessing fdt->fd[
89 files_lookup_fd_locked(struct files_struct *files, unsigned int fd) argument
100 close_on_exec(unsigned int fd, const struct files_struct *files) argument
[all...]
/linux-master/arch/sh/kernel/
H A Dsys_sh32.c28 int fd[2]; local
31 error = do_pipe_flags(fd, 0);
33 current_pt_regs()->regs[1] = fd[1];
34 return fd[0];
39 asmlinkage ssize_t sys_pread_wrapper(unsigned int fd, char __user *buf, argument
42 return ksys_pread64(fd, buf, count, pos);
45 asmlinkage ssize_t sys_pwrite_wrapper(unsigned int fd, const char __user *buf, argument
48 return ksys_pwrite64(fd, buf, count, pos);
51 asmlinkage int sys_fadvise64_64_wrapper(int fd, u32 offset0, u32 offset1, argument
55 return ksys_fadvise64_64(fd, (u6
[all...]
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dlwt_helpers.h44 int fd = open("/dev/net/tun", O_RDWR); local
46 if (!ASSERT_GT(fd, 0, "open(/dev/net/tun)"))
53 err = ioctl(fd, TUNSETIFF, &ifr);
55 close(fd);
59 err = fcntl(fd, F_SETFL, O_NONBLOCK);
61 close(fd);
65 return fd;
93 * @fd: tun fd/packet socket to read packet
99 static int wait_for_packet(int fd, filter_ argument
[all...]
/linux-master/samples/timers/
H A Dhpet_example.c82 int fd; local
89 fd = open(argv[0], O_RDONLY);
90 if (fd < 0)
93 close(fd);
102 int fd; local
109 fd = open(argv[0], O_RDONLY);
110 if (fd < 0) {
115 if (ioctl(fd, HPET_INFO, &info) < 0) {
126 close(fd);
134 int iterations, i, fd; local
226 int iterations, i, fd, value; local
[all...]
/linux-master/tools/testing/selftests/powerpc/papr_vpd/
H A Dpapr_vpd.c34 int fd; local
42 fd = ioctl(devfd, PAPR_VPD_IOC_CREATE_HANDLE, &lc);
44 FAIL_IF(fd < 0);
48 size = lseek(fd, 0, SEEK_END);
54 ssize_t consumed = pread(fd, buf, size, 0);
58 FAIL_IF(read(fd, buf, size) != 0);
59 FAIL_IF(close(fd));
72 int fd; local
80 fd = ioctl(devfd, PAPR_VPD_IOC_CREATE_HANDLE, &lc);
82 FAIL_IF(fd <
113 int fd; local
158 int fd; local
181 int fd; local
264 int fd; local
[all...]

Completed in 657 milliseconds

1234567891011>>