Searched refs:fd (Results 126 - 150 of 1405) sorted by relevance

1234567891011>>

/linux-master/tools/testing/selftests/netfilter/
H A Daudit_logread.c17 static int fd; variable
28 int audit_recv(int fd, struct audit_message *rep) argument
35 ret = recvfrom(fd, rep, sizeof(*rep), 0,
48 int audit_send(int fd, uint16_t type, uint32_t key, uint32_t val) argument
70 ret = sendto(fd, &msg, msg.nlh.nlmsg_len, 0,
79 int audit_set(int fd, uint32_t key, uint32_t val) argument
84 ret = audit_send(fd, AUDIT_SET, key, val);
88 ret = audit_recv(fd, &rep);
94 int readlog(int fd) argument
97 int ret = audit_recv(fd,
[all...]
/linux-master/tools/testing/selftests/mm/
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);
87 int fd, ret = -1; local
96 fd = open("/proc/sys/vm/nr_hugepages", O_RDWR | O_NONBLOCK);
97 if (fd < 0) {
104 if (read(fd, initial_nr_hugepage
[all...]
H A Dmemfd_secret.c46 static void test_file_apis(int fd) argument
50 if ((read(fd, buf, sizeof(buf)) >= 0) ||
51 (write(fd, buf, sizeof(buf)) >= 0) ||
52 (pread(fd, buf, sizeof(buf), 0) >= 0) ||
53 (pwrite(fd, buf, sizeof(buf), 0) >= 0))
59 static void test_mlock_limit(int fd) argument
68 mem = mmap(NULL, len, prot, mode, fd, 0);
76 mem = mmap(NULL, len, prot, mode, fd, 0);
86 static void try_process_vm_read(int fd, int pipefd[2]) argument
110 static void try_ptrace(int fd, in argument
161 test_remote_access(int fd, const char *name, void (*func)(int fd, int pipefd[2])) argument
201 test_process_vm_read(int fd) argument
206 test_ptrace(int fd) argument
265 int fd; local
[all...]
/linux-master/tools/testing/selftests/rtc/
H A Dsetdate.c23 int fd, retval; local
41 fd = open(rtc, O_RDONLY);
42 if (fd == -1) {
57 retval = ioctl(fd, RTC_SET_TIME, &new);
60 close(fd);
65 retval = ioctl(fd, RTC_RD_TIME, &current);
75 close(fd);
/linux-master/drivers/staging/greybus/Documentation/firmware/
H A Dauthenticate.c33 int fd, ret; local
45 fd = open(capdev, O_RDWR);
46 if (fd < 0) {
54 ret = ioctl(fd, CAP_IOC_GET_ENDPOINT_UID, &uid);
66 ret = ioctl(fd, CAP_IOC_GET_IMS_CERTIFICATE, &cert);
80 ret = ioctl(fd, CAP_IOC_AUTHENTICATE, &authenticate);
91 close(fd);
/linux-master/tools/testing/selftests/bpf/prog_tests/
H A Dfexit_stress.c8 int *fd, *fexit_fd, *link_fd; local
13 fd = calloc(bpf_max_tramp_links * 2, sizeof(*fd));
14 if (!ASSERT_OK_PTR(fd, "fd"))
16 fexit_fd = fd;
17 link_fd = fd + bpf_max_tramp_links;
58 free(fd);
/linux-master/tools/testing/selftests/memfd/
H A Dfuse_test.c46 int r, fd; local
48 fd = sys_memfd_create(name, flags);
49 if (fd < 0) {
55 r = ftruncate(fd, sz);
61 return fd;
64 static __u64 mfd_assert_get_seals(int fd) argument
68 r = fcntl(fd, F_GET_SEALS);
70 printf("GET_SEALS(%d) failed: %m\n", fd);
77 static void mfd_assert_has_seals(int fd, __u64 seals) argument
81 s = mfd_assert_get_seals(fd);
89 mfd_assert_add_seals(int fd, __u64 seals) argument
103 mfd_busy_add_seals(int fd, __u64 seals) argument
124 mfd_assert_mmap_shared(int fd) argument
142 mfd_assert_mmap_private(int fd) argument
231 int fd, mfd, r; local
[all...]
/linux-master/tools/perf/arch/x86/tests/
H A Damd-ibs-via-core-pmu.c45 int fd, i; local
52 fd = event_open(sub_tests[i].type, sub_tests[i].config);
53 pr_debug("type: 0x%x, config: 0x%lx, fd: %d - ", sub_tests[i].type,
54 sub_tests[i].config, fd);
55 if ((sub_tests[i].valid && fd == -1) ||
56 (!sub_tests[i].valid && fd > 0)) {
63 if (fd > 0)
64 close(fd);
/linux-master/arch/um/drivers/
H A Dxterm_kern.c16 int fd; member in struct:xterm_wait
24 int fd; local
26 fd = os_rcv_fd(xterm->fd, &xterm->pid);
27 if (fd == -EAGAIN)
30 xterm->new_fd = fd;
48 *data = ((struct xterm_wait) { .fd = socket,
/linux-master/tools/bootconfig/
H A Dmain.c134 static int load_xbc_fd(int fd, char **buf, int size) argument
142 ret = read(fd, *buf, size);
154 int fd, ret; local
156 fd = open(path, O_RDONLY);
157 if (fd < 0)
159 ret = fstat(fd, &stat);
163 ret = load_xbc_fd(fd, buf, stat.st_size);
165 close(fd);
176 static int load_xbc_from_initrd(int fd, char **buf) argument
184 ret = fstat(fd,
283 int ret, fd; local
331 int ret = 0, fd, size; local
368 int ret, fd; local
[all...]
/linux-master/arch/um/os-Linux/
H A Dirq.c90 * Helper to add a fd to epoll
92 int os_add_epoll_fd(int events, int fd, void *data) argument
99 result = epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &event);
101 result = os_mod_epoll_fd(events, fd, data);
103 printk("epollctl add err fd %d, %s\n", fd, strerror(errno));
108 * Helper to mod the fd event mask and/or data backreference
110 int os_mod_epoll_fd(int events, int fd, void *data) argument
117 result = epoll_ctl(epollfd, EPOLL_CTL_MOD, fd, &event);
120 "epollctl mod err fd
127 os_del_epoll_fd(int fd) argument
[all...]
/linux-master/tools/testing/selftests/net/
H A Dreuseaddr_conflict.c23 int fd = -1; local
51 if ((fd = socket(family, SOCK_STREAM, IPPROTO_TCP)) < 0) {
56 if (ipv6 && setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (void*)&v6only,
62 if (setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr,
68 if (bind(fd, addr, addrlen) < 0) {
74 return fd;
76 if (listen(fd, 1) < 0) {
80 return fd;
82 close(fd);
H A Dtun.c20 static int tun_attach(int fd, char *dev) argument
28 return ioctl(fd, TUNSETQUEUE, (void *) &ifr);
31 static int tun_detach(int fd, char *dev) argument
39 return ioctl(fd, TUNSETQUEUE, (void *) &ifr);
45 int fd, err; local
47 fd = open("/dev/net/tun", O_RDWR);
48 if (fd < 0) {
50 return fd;
57 err = ioctl(fd, TUNSETIFF, (void *) &ifr);
60 close(fd);
108 int fd, fd2; local
[all...]
H A Dso_incoming_cpu.c59 int fd, len, ret; local
61 fd = open(filename, O_WRONLY);
62 ASSERT_NE(fd, -1);
65 ret = write(fd, string, len);
115 void set_so_incoming_cpu(struct __test_metadata *_metadata, int fd, int cpu) argument
119 ret = setsockopt(fd, SOL_SOCKET, SO_INCOMING_CPU, &cpu, sizeof(int));
128 int fd, ret; local
130 fd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0);
131 ASSERT_NE(fd, -1);
134 set_so_incoming_cpu(_metadata, fd, cp
182 int i, j, fd, ret; local
212 int i, j, fd, cpu, ret, total = 0; local
[all...]
/linux-master/drivers/infiniband/hw/hfi1/
H A Duser_exp_rcv.c15 struct hfi1_filedata *fd);
17 static int set_rcvarray_entry(struct hfi1_filedata *fd,
29 static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *,
33 static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo);
34 static void __clear_tid_node(struct hfi1_filedata *fd,
36 static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node);
50 int hfi1_user_exp_rcv_init(struct hfi1_filedata *fd, argument
55 fd->entry_to_rb = kcalloc(uctxt->expected_count,
58 if (!fd->entry_to_rb)
62 fd
103 hfi1_user_exp_rcv_free(struct hfi1_filedata *fd) argument
132 unpin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf, struct tid_rb_node *node, unsigned int idx, unsigned int npages, bool mapped) argument
159 pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) argument
246 hfi1_user_exp_rcv_setup(struct hfi1_filedata *fd, struct hfi1_tid_info *tinfo) argument
483 hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd, struct hfi1_tid_info *tinfo) argument
518 hfi1_user_exp_rcv_invalid(struct hfi1_filedata *fd, struct hfi1_tid_info *tinfo) argument
656 program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *tbuf, struct tid_group *grp, u16 count, u32 *tidlist, unsigned int *tididx, unsigned int *pmapped) argument
723 set_rcvarray_entry(struct hfi1_filedata *fd, struct tid_user_buf *tbuf, u32 rcventry, struct tid_group *grp, u16 pageidx, unsigned int npages) argument
788 unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo) argument
818 __clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) argument
841 clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) argument
863 unlock_exp_tids(struct hfi1_ctxtdata *uctxt, struct exp_tid_set *set, struct hfi1_filedata *fd) argument
[all...]
/linux-master/tools/laptop/freefall/
H A Dfreefall.c42 int fd = open(unload_heads_path, O_RDONLY); local
44 if (fd < 0) {
49 close(fd);
56 int fd = open(path, O_RDWR); local
58 if (fd < 0) {
65 if (write(fd, buf, strlen(buf)) != strlen(buf)) {
70 close(fd);
108 int fd, ret; local
125 fd = open("/dev/freefall", O_RDONLY);
126 if (fd <
[all...]
/linux-master/arch/um/kernel/
H A Dsigio.c22 int write_sigio_irq(int fd) argument
26 err = um_request_irq(SIGIO_WRITE_IRQ, fd, IRQ_READ, sigio_interrupt,
33 sigio_irq_fd = fd;
/linux-master/tools/testing/selftests/timers/
H A Dclocksource-switch.c42 int fd, i; local
47 fd = open("/sys/devices/system/clocksource/clocksource0/available_clocksource", O_RDONLY);
49 size = read(fd, buf, 512);
51 close(fd);
77 int fd; local
79 fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_RDONLY);
81 size = read(fd, buf, size);
88 int fd; local
91 fd = open("/sys/devices/system/clocksource/clocksource0/current_clocksource", O_WRONLY);
93 if (fd <
[all...]
/linux-master/fs/hostfs/
H A Dhostfs_user.c42 int stat_file(const char *path, struct hostfs_stat *p, int fd) argument
46 if (fd >= 0) {
47 if (fstat64(fd, &buf) < 0)
73 int mode = 0, fd; local
85 fd = open64(path, mode);
86 if (fd < 0)
88 else return fd;
125 int read_file(int fd, unsigned long long *offset, char *buf, int len) argument
129 n = pread64(fd, buf, len, *offset);
136 int write_file(int fd, unsigne argument
147 lseek_file(int fd, long long offset, int whence) argument
157 fsync_file(int fd, int datasync) argument
170 replace_file(int oldfd, int fd) argument
187 int fd; local
195 set_attr(const char *file, struct hostfs_iattr *attrs, int fd) argument
[all...]
/linux-master/fs/hfs/
H A Dbrec.c14 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd);
15 static int hfs_brec_update_parent(struct hfs_find_data *fd);
65 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) argument
74 tree = fd->tree;
75 if (!fd->bnode) {
81 fd->bnode = node;
82 fd->record = -1;
85 key_len = (fd->search_key->key_len | 1) + 1;
88 rec = fd->record + 1;
91 node = fd
177 hfs_brec_remove(struct hfs_find_data *fd) argument
231 hfs_bnode_split(struct hfs_find_data *fd) argument
352 hfs_brec_update_parent(struct hfs_find_data *fd) argument
[all...]
/linux-master/tools/testing/selftests/proc/
H A Dfd-001-lookup.c16 // Test /proc/*/fd lookup.
53 static void test_lookup(unsigned int fd) argument
60 snprintf(buf, sizeof(buf), "/proc/self/fd/%u", fd);
67 snprintf(buf, sizeof(buf), "/proc/self/fd/%c%u", c, fd);
75 snprintf(buf, sizeof(buf), "/proc/self/fd/%u%c", fd, c);
80 snprintf(buf, sizeof(buf), "/proc/self/fd/%d", i);
84 snprintf(buf, sizeof(buf), "/proc/self/fd/
102 unsigned int fd, target_fd; local
126 unsigned int fd; local
[all...]
/linux-master/tools/power/acpi/tools/ec/
H A Dec_access.c125 void dump_ec(int fd) argument
131 bytes_read = read(fd, buf, EC_SPACE_SIZE);
151 lseek(fd, 0, SEEK_SET);
154 bytes_read = read(fd, buf2, EC_SPACE_SIZE);
175 void read_ec_val(int fd, int byte_offset) argument
180 error = lseek(fd, byte_offset, SEEK_SET);
184 error = read(fd, &buf, 1);
192 void write_ec_val(int fd, int byte_offset, uint8_t value) argument
196 error = lseek(fd, byte_offset, SEEK_SET);
200 error = write(fd,
209 int fd; local
[all...]
/linux-master/arch/powerpc/include/asm/
H A Dsyscalls.h57 unsigned long fd, off_t offset);
60 unsigned long fd, unsigned long pgoff);
93 long sys_ppc_pread64(unsigned int fd,
96 long sys_ppc_pwrite64(unsigned int fd,
99 long sys_ppc_readahead(int fd, u32 r4,
103 long sys_ppc_ftruncate64(unsigned int fd, u32 reg4,
105 long sys_ppc32_fadvise64(int fd, u32 unused, u32 offset1, u32 offset2,
107 long sys_ppc_sync_file_range2(int fd, unsigned int flags,
112 long sys_ppc_fallocate(int fd, int mode, u32 offset1, u32 offset2,
118 unsigned long fd, unsigne
[all...]
/linux-master/fs/hfsplus/
H A Dbrec.c15 static struct hfs_bnode *hfs_bnode_split(struct hfs_find_data *fd);
16 static int hfs_brec_update_parent(struct hfs_find_data *fd);
63 int hfs_brec_insert(struct hfs_find_data *fd, void *entry, int entry_len) argument
72 tree = fd->tree;
73 if (!fd->bnode) {
79 fd->bnode = node;
80 fd->record = -1;
83 key_len = be16_to_cpu(fd->search_key->key_len) + 2;
86 rec = fd->record + 1;
89 node = fd
179 hfs_brec_remove(struct hfs_find_data *fd) argument
235 hfs_bnode_split(struct hfs_find_data *fd) argument
356 hfs_brec_update_parent(struct hfs_find_data *fd) argument
[all...]
/linux-master/tools/testing/selftests/dmabuf-heaps/
H A Ddmabuf-heap.c21 static int check_vgem(int fd) argument
30 ret = ioctl(fd, DRM_IOCTL_VERSION, &version);
39 int i, fd; local
42 fd = -1;
48 fd = open(name, O_RDWR);
49 if (fd < 0)
52 if (!check_vgem(fd)) {
53 close(fd);
54 fd = -1;
60 return fd;
89 int ret, fd; local
104 dmabuf_heap_alloc_fdflags(int fd, size_t len, unsigned int fd_flags, unsigned int heap_flags, int *dmabuf_fd) argument
125 dmabuf_heap_alloc(int fd, size_t len, unsigned int flags, int *dmabuf_fd) argument
132 dmabuf_sync(int fd, int start_stop) argument
299 dmabuf_heap_alloc_older(int fd, size_t len, unsigned int flags, int *dmabuf_fd) argument
306 __u32 fd; member in struct:dma_heap_allocation_data_smaller
327 dmabuf_heap_alloc_newer(int fd, size_t len, unsigned int flags, int *dmabuf_fd) argument
334 __u32 fd; member in struct:dma_heap_allocation_data_bigger
[all...]

Completed in 212 milliseconds

1234567891011>>