LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 05-09-2010, 02:34 AM   #1
santosh.sajjan
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Rep: Reputation: 0
Smile system call used by SIZE command


am trying to implement a size command in C...

pls any one can help me which system call a have to use




thanQ in advance
 
Old 05-09-2010, 03:35 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Q: Is this a homework assignment?

Q: What have you tried so far? What's not working?
 
Old 05-09-2010, 03:48 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Have you looked at the size command source code? The size man page footer shows that size is part of the GNU binutils package. Netsearching for binutils and "source code" finds GNU's binutils page which has a link to the source code. There's no better reference or authority than that
 
Old 05-10-2010, 02:24 AM   #4
santosh.sajjan
LQ Newbie
 
Registered: Apr 2010
Posts: 2

Original Poster
Rep: Reputation: 0
No its not assignment...

i tried using read system call to get the first 32 bits of the executable to Elf32_Ehrd.
 
Old 05-11-2010, 10:02 AM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

"size" and "objdump" are command-line tools that help you parse an ELF-format binary file. There are no equivalent system calls.

"od" is a command-line tool to help you dump the binary contents of a file; you can do a "read()" to get the bits directly from the file.

If you want to programmatically do some of the same things that "size" or "objdump" do for you, then your best bet is to study the Gnu binutils source code (as catkins suggested about).

'Hope that helps .. PSM
 
  


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
Finding Directroy size using system call HeartBeat Linux - Newbie 2 06-17-2009 04:04 AM
command and its corresponding system call darwins Linux - Kernel 3 12-25-2008 08:31 AM
list file system linux supports "please give the command or system call" varun_shrivastava Linux - General 4 01-09-2007 07:28 AM
Is Mount a system call or shell command? comeon Linux - Software 8 02-20-2005 11:55 PM
how to call a system command with java applet? nickhx Programming 4 08-11-2004 12:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:04 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