LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   system call used by SIZE command (https://www.linuxquestions.org/questions/linux-newbie-8/system-call-used-by-size-command-806741/)

santosh.sajjan 05-09-2010 02:34 AM

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

paulsm4 05-09-2010 03:35 AM

Q: Is this a homework assignment?

Q: What have you tried so far? What's not working?

catkin 05-09-2010 03:48 AM

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 :)

santosh.sajjan 05-10-2010 02:24 AM

No its not assignment...

i tried using read system call to get the first 32 bits of the executable to Elf32_Ehrd.

paulsm4 05-11-2010 10:02 AM

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


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