Add shell script to copy files to source tree
[eleutheria.git] / cdev / test.c
blob9b13999c4fc18260aa8821e34785f33a34af3e62
1 #include <fcntl.h>
2 #include <stdio.h>
3 #include <stdlib.h>
4 #include <string.h>
5 #include <sys/ioctl.h>
6 #include <sys/mydev.h>
8 int main()
10 struct mydev_params params;
11 int mydev_dev;
13 params.number = 42;
14 strcpy(params.string, "Hello World");
16 if ((mydev_dev = open("/dev/mydev", O_RDONLY, 0)) < 0) {
17 fprintf(stderr, "Failed to open /dev/mydev\n");
18 exit(2);
21 if (ioctl(mydev_dev, MYDEVTEST, &params) < 0) {
22 perror("ioctl failed");
23 exit(2);
26 exit(0);