mirror of
https://github.com/Hizenberg469/Driver-tutorial.git
synced 2026-04-20 00:42:25 +03:00
25 lines
503 B
C
25 lines
503 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
#include <sys/types.h>
|
|
#include <fcntl.h>
|
|
|
|
int main(){
|
|
int fd1, fd2;
|
|
char buf[10];
|
|
int n;
|
|
fd1 = open("./pone", O_RDWR);
|
|
fd2 = open("./ptwo", O_RDWR);
|
|
|
|
printf(" Trying to read from pone \n");
|
|
n = read( fd1, buf, 10);
|
|
|
|
printf(" read data = %s from pone \n", buf);
|
|
printf(" Trying to read from ptwo\n");
|
|
n = read( fd2, buf, 10);
|
|
|
|
printf(" read data = %s from ptwo \n", buf);
|
|
|
|
close(fd1);
|
|
close(fd2);
|
|
return 0;
|
|
} |