The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to call the c library created by shc alfredo High Level Programming 1 03-31-2008 09:26 AM
How to call the c library created by shc alfredo Shell Programming and Scripting 0 03-31-2008 09:20 AM
c system call rangaswamy High Level Programming 1 02-19-2008 10:53 AM
tcsh user failed to call library in ksh program nir_s Shell Programming and Scripting 1 04-04-2006 05:29 AM
exec() system call a25khan High Level Programming 2 02-02-2004 09:06 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-19-2007
Registered User
 

Join Date: Jun 2006
Posts: 15
how to differentiate system call from library call

Hi,
Ho do I differentiate system call from library call?
for example if I am using chmod , how do I find out if it is a system call or library call?

Thanks
Muru
Reply With Quote
Forum Sponsor
  #2  
Old 07-19-2007
blowtorch's Avatar
Supporter
 
Join Date: Dec 2004
Location: Singapore
Posts: 2,328
Check the man page. For chmod it will be something like chmod(2). Your OS will have specific sections of the man pages dedicated to things like system calls, user commands, admin commands, files and so on. The (2) usually means system call on most systems. Now check the man page for something else like fprintf. You will see either fprintf(3C) or fprintf(3). On most systems, section 3/3C is for library functions.
Reply With Quote
  #3  
Old 07-19-2007
Registered User
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by muru View Post
How do I differentiate system call from library call?
Look in "/usr/include/sys/syscall.h" or equivalent for a macro identifying an index for that call

Quote:
Originally Posted by muru View Post
for example if I am using chmod , how do I find out if it is a system call or library call?
You may not be able to as you link with libc.a (or similar) and that provides the calls, these may be a full implementation or a wrapper around the actual system call.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0