LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-20-2006, 07:28 AM   #1
George2
Member
 
Registered: Oct 2003
Posts: 354

Rep: Reputation: 30
how to get all invoked system API of a program


Hello everyone,


Suppose we have the source codes, how to get all invoked system API (like printf, open, etc.) other than program self-defined API? Are there any existing tools?

Either on Windows or on Linux platform is ok.


thanks in advance,
George
 
Old 07-20-2006, 07:40 AM   #2
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
is truss on linux?

strace might do what you want

do man -k system | grep calls

Last edited by bigearsbilly; 07-20-2006 at 07:42 AM.
 
Old 07-21-2006, 01:34 AM   #3
George2
Member
 
Registered: Oct 2003
Posts: 354

Original Poster
Rep: Reputation: 30
Thank you bigearsbilly!


Quote:
Originally Posted by bigearsbilly
is truss on linux?

strace might do what you want

do man -k system | grep calls
I have checked that strace can only get the system calls, when the program runs. But as you know, program may invoke different system calls according to different scenarios. So, I think the best way is to analyze the complete list of invoked system calls, is to analyze statically other than dynamically (when program runs) by analyzing the executable file -- other than the running process, agree?


Could strace analyze statically on an executable file other than the running process? Any comments?


regards,
George

Last edited by George2; 07-21-2006 at 01:35 AM.
 
Old 07-21-2006, 02:12 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,788

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Suppose we have the source codes, how to get all invoked system API (like printf, open, etc.) other than program self-defined API? Are there any existing tools?
Yes, simply run this command:

Code:
nm -u <your-binary-program>
 
  


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
C/C++ API for retrieving system time in micro or milliseconds syseeker Programming 1 05-04-2006 07:15 AM
Where is dhcpc invoked from? natedawg_38929 Slackware 6 03-23-2004 02:43 AM
What API do you program Linux apps in? Ekim Gram Programming 9 01-17-2004 04:58 PM
IRQ4 Serial Port Not invoked sinux Linux - Hardware 1 03-06-2003 03:45 PM
How to tell the shell program is invoked from GUI environment? oldbee Programming 9 01-20-2002 09:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:29 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
Open Source Consulting | Domain Registration