how does open works for normal file and device drivers
问题 Currently, I am learning Linux device drivers. And got stuck over how opening a device file works ? What I got until now... Consider the a simple code that opens a normal file.. #incldue<stdio.h> int main() { FILE fp; char buffer[20]; fp = fopen(/home/yoggi/foo.txt, "r"); fread(buffer, 5, 1, fp); } In above program, The fopen(), c-library function, is a wrapper function to the system call open() , which intern calls sys_open() or file_open() in VFS layer function. As linux supports a number