Would anyone be able to give me a valid perl 'unpack()' function template ( like $template = "s i A12 A4 A32 A256 s s l i i A20"; ), based on the following definition:
struct utmp {
short ut_type; /* type of login */
pid_t ut_pid; /* pid of login process */
char ut_line[UT_LINESIZE]; /* device name of tty âË?â?? "/dev/" */
char ut_id[4]; /* init id or abbrev. ttyname */
char ut_user[UT_NAMESIZE]; /* user name */
char ut_host[UT_HOSTSIZE]; /* hostname for remote login */
struct exit_status ut_exit; /* The exit status of a process
marked as DEAD_PROCESS. */
long ut_session; /* session ID, used for windowing*/
struct timeval ut_tv; /* time entry was made. */
int32_t ut_addr_v6[4]; /* IP address of remote host. */
char pad[20]; /* Reserved for future use. */
};
where the exit_status struct is defined as such ...
struct exit_status {
short int e_termination; /* process termination status. */
short int e_exit; /* process exit status. */
};
??
I've tried a lot of different combinations, none of which have panned out yet.
Thanks for any and all help!
dotBomb
struct utmp {
short ut_type; /* type of login */
pid_t ut_pid; /* pid of login process */
char ut_line[UT_LINESIZE]; /* device name of tty âË?â?? "/dev/" */
char ut_id[4]; /* init id or abbrev. ttyname */
char ut_user[UT_NAMESIZE]; /* user name */
char ut_host[UT_HOSTSIZE]; /* hostname for remote login */
struct exit_status ut_exit; /* The exit status of a process
marked as DEAD_PROCESS. */
long ut_session; /* session ID, used for windowing*/
struct timeval ut_tv; /* time entry was made. */
int32_t ut_addr_v6[4]; /* IP address of remote host. */
char pad[20]; /* Reserved for future use. */
};
where the exit_status struct is defined as such ...
struct exit_status {
short int e_termination; /* process termination status. */
short int e_exit; /* process exit status. */
};
??
I've tried a lot of different combinations, none of which have panned out yet.
Thanks for any and all help!
dotBomb