Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-07-2006, 04:58 AM   #1
LQ Newbie
Registered: Mar 2006
Posts: 6

Rep: Reputation: 0
problem when writing a new system call

i want to know hoe to write a new system call for e.g., adding two numbers.
please help me in writing this code.
Old 03-08-2006, 03:40 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
Old 03-08-2006, 06:51 PM   #3
Senior Member
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
What context are you talking about? From a shell?
Old 03-25-2006, 09:40 AM   #4
Senior Member
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
A little detail about what you have tried and what isn't working might help.

Writing a system call (Assuming your refering to a kernel syscall) is an interesting exercise in learning about how the kernel works, but it is usually a bad idea to depend on custom system calls in your software (which is'nt here nor there, but I thought I'd float out my usual disclaimer).

I'd recommend you pick up a book (Such as Understanding the Linux Kernel). It has been a while, but I believe there are a few things you need to do.

1. Put the prototype for your function in include/linux/syscalls.h. As you'll notice, almost all (if not all) system calls start with the sys_ designation.

2. Update the syscall table for your arch (or for the generic case..)

3. Write the function.

4. Write a userspace library to call the function.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with adding a system call newcat Programming 17 04-08-2006 07:50 AM
To add our own system call,compilation problem hegdeshashi Linux - Networking 1 01-28-2006 12:13 AM
Problem using 'read' system call buckles Programming 6 05-10-2005 12:45 PM
Problem w/ 'read' system call - RH 7.3 buckles Linux - Newbie 3 05-07-2005 01:03 AM
Problem in setgroups system call ppy Programming 1 11-04-2004 09:52 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration