LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-28-2013, 11:01 AM   #1
anji
LQ Newbie
 
Registered: Jul 2013
Posts: 1

Rep: Reputation: Disabled
how system calls is used? and hw can it be demonstrated in c?


how can we demonstrate following system calls in C??
<sys_clone,sys_setdomainname, sys_mprotect, sys_modify_ldt, sys_uname, sys_adjtimex, sys_sigprocmask>

Last edited by anji; 07-28-2013 at 11:02 AM.
 
Old 07-28-2013, 12:27 PM   #2
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,516

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
You generally do not want to invoke sys_calls directly; there are library functions or utility programs that are designed specifically to be used in place of sys_calls and you really want to use those instead (they all have manual pages that explain how to use them).

For example, the clone() function is explained in the manual page, man clone; the manual page also includes a description of sys_clone call -- carefully read the manual page(s) before you start experimenting.

In most cases, the Linux library functions or utility programs are also supported on other platforms (notably Unix platforms); however:
Quote:
The clone() and sys_clone calls are Linux-specific and should not be used in pro‐
grams intended to be portable.
Thus, the use of either should be avoided both for portability reasons and that they may not be available in future versions of Linux.

Take a look at the manual pages for the functions you're interested in (such as man clone, man setdomainname, etc.).

You may also find it useful to use Google to find examples of their use.

Hope this helps some.
 
  


Reply


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
how does java calls the system calls which are written in c babu198649 Linux - General 3 12-05-2011 04:40 AM
System Calls AlbertJJ Programming 7 10-27-2010 10:45 AM
system calls with C khodeir Programming 4 03-12-2009 09:26 PM
LXer: RandR 1.3 Explained, Demonstrated LXer Syndicated Linux News 0 02-08-2009 03:50 PM
Some system calls Spooky Programming 1 11-24-2004 11:17 AM


All times are GMT -5. The time now is 06:09 AM.

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