-   Programming (
-   -   process of creating system call (

surabhi suppu 03-24-2011 11:23 AM

process of creating system call
Hi ..,
how to create a new system call Linux? what is the process of creating ?my project is to create a system call for displaying owner of a file..where exactly we have to write the system call code? and where are the places need to change ?
Thank u

rtmistler 03-24-2011 11:43 AM

You just need to create a binary program that performs the actions you wish and then place that in a directory that is included in your path; typically /usr/sbin is a good choice.

If you're talking about adding to your shell, then you'll need to grab the source for that shell and rebuild it. Typically that's not a necessity and you just need a script or executable that accomplishes the task you wish. For that matter, you can use a script to get the output of ls and use sed to edit that output to be in a suitable form.

unSpawn 03-24-2011 01:27 PM


Originally Posted by surabhi suppu (Post 4301842)
my project is to create a system call

If this is your project then you should start by doing research. O'Reilly's Understanding the Linux Kernel version 3 (ULK3) would be a suggested starting point to read about how binaries interact with libraries and how userland interacts with the kernel. Then using your favorite search engine to search for "create system call" (and searching LQ for the same) should yield a ton of examples.

bsat 03-25-2011 12:26 AM

This might help

There is enough material available on line if you search

TheIndependentAquarius 03-25-2011 02:24 AM

and hit out Google with the keywords:
Tldp implementing a system call Linux 2.6

Tinkster 04-14-2011 02:07 PM

Moved: This thread is more suitable in <PROGRAMMING> and has been moved accordingly to help your thread/question get the exposure it deserves.

All times are GMT -5. The time now is 11:37 PM.