Where do i find system call implementation code? *for read, write, open, close*
search for SYSCALL_DEFINE<X>(syscall) in linux source e.g. SYSCALL_DEFINE3(open, const char __user *, filename, int, flags, int, mode) in fs/open.c here <X> depends on number of arguments to system call: 3 in case of open. you would find open, read, write and close in fs directory only. -Rajat On Sat, Jun 11, 2011 at 3:09 PM, Venkateswarlu P <p.venkatesh551@gmail.com> wrote:
Where do i find system call implementation code?
for read, write, open, close _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Sat, Jun 11, 2011 at 6:39 PM, Venkateswarlu P <p.venkatesh551@gmail.com> wrote:
Where do i find system call implementation code?
for read, write, open, close
For file system related syscalls, it would depend on the fs implementation. The Virtual File System only defines a uniform common high level layer but is the responsibility of every fs to actually implement the file operations (open, read, write, etc). There is some generic file operations in linux/fs/read_write.c that are used for simple fs like romfs and ramfs. I would recommend start looking at these memory file systems first. Then you could look how real file systems operations are implemented. Every fs usually have a file.c file where a struct file_operations is defined. This structure has a function pointer for every file operation. The functions asigned to these function pointers are the ones that actually implements the operations. Some of these could be generic operations and some of them are fs specific. Hope it helps, -- Javier Martínez Canillas (+34) 682 39 81 69 PhD Student in High Performance Computing Computer Architecture and Operating System Department (CAOS) Universitat Autònoma de Barcelona Barcelona, Spain
participants (3)
-
Javier Martinez Canillas -
Rajat Sharma -
Venkateswarlu P