/samples/hidraw/ |
D | hid-example.c | 46 char buf[256]; in main() local 65 memset(buf, 0x0, sizeof(buf)); in main() 87 res = ioctl(fd, HIDIOCGRAWNAME(256), buf); in main() 91 printf("Raw Name: %s\n", buf); in main() 94 res = ioctl(fd, HIDIOCGRAWPHYS(256), buf); in main() 98 printf("Raw Phys: %s\n", buf); in main() 113 buf[0] = 0x9; /* Report Number */ in main() 114 buf[1] = 0xff; in main() 115 buf[2] = 0xff; in main() 116 buf[3] = 0xff; in main() [all …]
|
/samples/kfifo/ |
D | record-example.c | 73 char buf[100]; in testfunc() local 76 struct { unsigned char buf[6]; } hello = { "hello" }; in testfunc() member 87 memset(buf, 'a' + i, i + 1); in testfunc() 88 kfifo_in(&test, buf, i + 1); in testfunc() 98 ret = kfifo_out_peek(&test, buf, sizeof(buf)); in testfunc() 100 printk(KERN_INFO "%.*s\n", ret, buf); in testfunc() 105 ret = kfifo_out(&test, buf, sizeof(buf)); in testfunc() 106 buf[ret] = '\0'; in testfunc() 107 printk(KERN_INFO "item = %.*s\n", ret, buf); in testfunc() 108 if (strcmp(buf, expected_result[i++])) { in testfunc() [all …]
|
D | bytestream-example.c | 56 unsigned char buf[6]; in testfunc() local 73 i = kfifo_out(&test, buf, 5); in testfunc() 74 printk(KERN_INFO "buf: %.*s\n", i, buf); in testfunc() 77 ret = kfifo_out(&test, buf, 2); in testfunc() 80 ret = kfifo_in(&test, buf, ret); in testfunc() 115 static ssize_t fifo_write(struct file *file, const char __user *buf, in fifo_write() argument 124 ret = kfifo_from_user(&test, buf, count, &copied); in fifo_write() 131 static ssize_t fifo_read(struct file *file, char __user *buf, in fifo_read() argument 140 ret = kfifo_to_user(&test, buf, count, &copied); in fifo_read()
|
D | inttype-example.c | 56 int buf[6]; in testfunc() local 70 ret = kfifo_out(&test, buf, 2); in testfunc() 73 ret = kfifo_in(&test, buf, ret); in testfunc() 108 static ssize_t fifo_write(struct file *file, const char __user *buf, in fifo_write() argument 117 ret = kfifo_from_user(&test, buf, count, &copied); in fifo_write() 124 static ssize_t fifo_read(struct file *file, char __user *buf, in fifo_read() argument 133 ret = kfifo_to_user(&test, buf, count, &copied); in fifo_read()
|
/samples/kobject/ |
D | kobject-example.c | 31 char *buf) in foo_show() argument 33 return sprintf(buf, "%d\n", foo); in foo_show() 37 const char *buf, size_t count) in foo_store() argument 41 ret = kstrtoint(buf, 10, &foo); in foo_store() 57 char *buf) in b_show() argument 65 return sprintf(buf, "%d\n", var); in b_show() 69 const char *buf, size_t count) in b_store() argument 73 ret = kstrtoint(buf, 10, &var); in b_store()
|
D | kset-example.c | 42 ssize_t (*show)(struct foo_obj *foo, struct foo_attribute *attr, char *buf); 43 ssize_t (*store)(struct foo_obj *foo, struct foo_attribute *attr, const char *buf, size_t count); 56 char *buf) in foo_attr_show() argument 67 return attribute->show(foo, attribute, buf); in foo_attr_show() 76 const char *buf, size_t len) in foo_attr_store() argument 87 return attribute->store(foo, attribute, buf, len); in foo_attr_store() 115 char *buf) in foo_show() argument 117 return sprintf(buf, "%d\n", foo_obj->foo); in foo_show() 121 const char *buf, size_t count) in foo_store() argument 125 ret = kstrtoint(buf, 10, &foo_obj->foo); in foo_store() [all …]
|
/samples/bpf/ |
D | bpf_load.c | 56 char buf[256]; in load_and_attach() local 117 snprintf(buf, sizeof(buf), in load_and_attach() 120 err = system(buf); in load_and_attach() 127 strcpy(buf, DEBUGFS); in load_and_attach() 128 strcat(buf, "events/kprobes/"); in load_and_attach() 129 strcat(buf, event); in load_and_attach() 130 strcat(buf, "/id"); in load_and_attach() 138 strcpy(buf, DEBUGFS); in load_and_attach() 139 strcat(buf, "events/"); in load_and_attach() 140 strcat(buf, event); in load_and_attach() [all …]
|
D | test_overhead_user.c | 38 char buf[] = "test\n"; in test_task_rename() local 48 write(fd, buf, sizeof(buf)); in test_task_rename() 57 char buf[4]; in test_urandom_read() local 67 read(fd, buf, sizeof(buf)); in test_urandom_read()
|
D | trace_output_user.c | 70 char buf[256]; in perf_event_read() local 89 memcpy(buf, begin, len); in perf_event_read() 90 memcpy(buf + len, base, e->header.size - len); in perf_event_read() 91 e = (void *) buf; in perf_event_read()
|
D | xdp1_user.c | 25 char buf[4096]; in set_link_xdp_fd() local 74 len = recv(sock, buf, sizeof(buf), 0); in set_link_xdp_fd() 80 for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len); in set_link_xdp_fd()
|
D | bpf_helpers.h | 32 static int (*bpf_get_current_comm)(void *buf, int buf_size) =
|
/samples/connector/ |
D | ucon.c | 65 char buf[128]; in netlink_send() local 70 nlh = (struct nlmsghdr *)buf; in netlink_send() 114 char buf[1024]; in main() local 151 memset(buf, 0, sizeof(buf)); in main() 180 memset(buf, 0, sizeof(buf)); in main() 182 data = (struct cn_msg *)buf; in main() 221 memset(buf, 0, sizeof(buf)); in main() 222 len = recv(s, buf, sizeof(buf), 0); in main() 228 reply = (struct nlmsghdr *)buf; in main()
|
/samples/seccomp/ |
D | bpf-fancy.c | 33 char buf[256]; in main() local 47 JNE((unsigned long)buf, DENY), in main() 49 JGE(sizeof(buf), DENY), in main() 62 JEQ((unsigned long)buf, JUMP(&l, buf_len)), in main() 77 JLT(sizeof(buf), ALLOW), in main() 97 bytes = syscall(__NR_read, STDIN_FILENO, buf, sizeof(buf)-1); in main() 100 syscall(__NR_write, STDERR_FILENO, buf, bytes); in main()
|
D | bpf-direct.c | 65 char *buf; in emulator() local 73 buf = (char *) ctx->uc_mcontext.gregs[REG_ARG1]; in emulator() 83 bytes = write(STDOUT_FILENO, buf, len); in emulator() 165 char buf[4096]; in main() local 173 bytes = syscall(__NR_read, STDIN_FILENO, buf, sizeof(buf)); in main() 175 syscall(__NR_write, STDOUT_FILENO, buf, bytes); in main()
|
/samples/uhid/ |
D | uhid-example.c | 302 char buf[128]; in keyboard() local 305 ret = read(STDIN_FILENO, buf, sizeof(buf)); in keyboard() 315 switch (buf[i]) { in keyboard() 379 fprintf(stderr, "Invalid input: %c\n", buf[i]); in keyboard()
|
/samples/v4l/ |
D | v4l2-pci-skeleton.c | 216 struct skel_buffer *buf = to_skel_buffer(vb); in buffer_queue() local 220 list_add_tail(&buf->list, &skel->buf_list); in buffer_queue() 230 struct skel_buffer *buf, *node; in return_all_buffers() local 234 list_for_each_entry_safe(buf, node, &skel->buf_list, list) { in return_all_buffers() 235 vb2_buffer_done(&buf->vb, state); in return_all_buffers() 236 list_del(&buf->list); in return_all_buffers()
|