For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > September 2006 > unpack template for AIX utmp struct









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author unpack template for AIX utmp struct
bujecas

2006-09-06, 4:27 pm

Hello,
I'm trying to figure out the unpack template for the AIX utmp struct.

This is the C struct:
code:
struct utmp { char ut_user[256] ; /* User login name */ char ut_id[14] ; /* /etc/inittab id */ char ut_line[64] ; /* device name (console, lnxx) */ pid_t ut_pid ; /* process id */ short ut_type ; /* type of entry */ #if !defined(__64BIT__) && !defined(__ia64) int __time_t_space; /* for 32vs64-bit time_t PPC */ #endif time_t ut_time ; /* time entry was made */ #if !defined(__64BIT__) && defined(__ia64) int __time_t_space; /* for 32vs64-bit time_t IA64 */ #endif struct exit_status { short e_termination ; /* Process termination status */ short e_exit ; /* Process exit status */ } ut_exit ; /* The exit status of a process * marked as DEAD_PROCESS. */ char ut_host[256] ; /* host name */ int __dbl_word_pad; /* for double word alignment */ int __reservedA[2]; int __reservedV[6]; } ;


I've tried this templates:
A256 A14 A64 l s x2 l l s2 A256 l l2 l6
A256 A14 A64 l s x2 l l s2 A256 l x8 x24
A256 A14 A64 l s x2 l s2 A256 l l2 l6
A256 A14 A64 l s x2 l s2 A256 l x8 x24

All of them gives the error: "x outside of string"

I think that the "#if defines" confuses a little.

Any help?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com