Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 9th, 2005, 1:00 AM   #1
bioman
Newbie
 
Join Date: Mar 2005
Posts: 1
Rep Power: 0 bioman is on a distinguished road
Finding a struct member in Assembly?

I am trying to call a function in Assembly, but I don't know how to access a struct member of the return value. The function I am trying to call is getgrgid(), which has definition: struct group *getgrgid(gid_t gid); After I call the function and set the return value to a local register, I want to access and return a struct member of the return value.

Here are the instructions:
displayGroupName.s

This routine will call getgrgid() to get a pointer to the struct group for this gid so we can get the group's name as a string (gr_name member). If the group entry cannot be found, just print the numeric value of the gid. In either case, the group's name or gid will be printed with a field width of 8 left justified. Use the left-adjustment flag '-' in the printf format specifier.


How the hell do I do this?

Thanks.
bioman is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:59 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC