ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.