LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-06-2004, 02:43 AM   #1
Arelys Monge
LQ Newbie
 
Registered: May 2004
Posts: 1

Rep: Reputation: 0
Unhappy Troubles using fstat() on assembler...


I have been trying to use fstat() to get info about files. I am using Gas as an assembler , but I guess it works the same way on NASM....I already have defined the buffer that the system calls needs, ( I declared it as .fill ). So.. I read the man page, anf it gives a "detailed" description of the things this returns in muy buffer,... The trouble I have is that I don't know how to access them, I have only a bunch a numbers on my data segment and I don't know how to relate them to the structure the man describes. How much bytes does each point on the structure have? How do I know which number is which point?I need the mode, the uid, gid, and the route of the file... I really need help on this.. I've been stuck for a hours and I need it for a homework.

Thanks
 
Old 05-06-2004, 10:29 AM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
look up the stat structure in the proper header file, and then write a C program that prints the offset of each member from the start of structure. and then in asm:

movl $addr_stat_structure, %eax
movl $offset_of_member(%eax), %ebx
print $ebx

obviously print is something u need to create.
 
  


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
Trying to get hold of fstat for debian jimieee Linux - Software 2 05-05-2005 07:43 AM
Assembler Firari Programming 9 12-10-2004 03:26 PM
assembler usr Programming 2 11-15-2003 06:15 PM
Using fstat() tim_l Linux - Software 0 10-10-2003 11:20 AM
Need an Assembler ChimpFace9000 Programming 1 07-18-2001 10:36 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration