reading utmp 
Author Message
 reading utmp

Hi.. I'm having trouble reading /etc/utmp... I read in 32 bytes and unpack
it with "a8 a4 a12 s s s s L"... but no luck.  Here is the structure..

     struct utmp {
            char       ut_user[8];        
            char       ut_id[4];
            char       ut_line[12];
            short      ut_pid;    
            short      ut_type;    
            struct     exit_status {
                short      e_termination;
                short      e_exit;  
            } ut_exit;              
            time_t     ut_time;
     };

when I ran c2ph < /usr/include/utmp.h > utmp.ph  it only returned 1; or
something like that..

(By the way.. this is on an SGI running Irix.. )

thanks for any help..

--



Wed, 19 Jun 1996 02:57:47 GMT  
 reading utmp

:Hi.. I'm having trouble reading /etc/utmp... I read in 32 bytes and unpack
:it with "a8 a4 a12 s s s s L"... but no luck.  Here is the structure..
:
:     struct utmp {
:            char       ut_user[8];        
:            char       ut_id[4];
:            char       ut_line[12];
:            short      ut_pid;    
:            short      ut_type;    
:            struct     exit_status {
:                short      e_termination;
:                short      e_exit;  
:            } ut_exit;              
:            time_t     ut_time;
:     };
:
:when I ran c2ph < /usr/include/utmp.h > utmp.ph  it only returned 1; or
:something like that..
:
:(By the way.. this is on an SGI running Irix.. )

c2ph isn't as happy in filter mode as it ought to be.  Oops.  Try
removing the less-than arrow on the input redirection.

It's also highly likely that the problem lies in that it doens't have a C
compiler that outputs stab information.  You should run it with trace mode
(-t) to see what it's actually doing.  You will likely have to use gcc on
an SGI machine, passing c2ph CC=gdb and DEFINES='-g -S -stabs', I believe.

Also, make sure you use c2ph version 1.5, not 1.3, or your a8 a4 a12
will become a c24.

--tom
--

      "Will Hack Perl for Fine Food and Fun"
        Boulder Colorado  303-444-3212



Wed, 19 Jun 1996 22:59:30 GMT  
 reading utmp


Quote:

>It's also highly likely that the problem lies in that it doens't have a C
>compiler that outputs stab information.  You should run it with trace mode
>(-t) to see what it's actually doing.  You will likely have to use gcc on
>an SGI machine, passing c2ph CC=gdb and DEFINES='-g -S -stabs', I believe.

Here is the result of runnint it in trace mode...  and its only output..


cat /usr/include/utmp.h > /tmp/c2ph.25640.c
cd /tmp; cc -g -S  /tmp/c2ph.25640.c
reading from /tmp/c2ph.25640.s: 2
computing intrinsic sizes: done
resolving types
building type templates:
dumping structs:

1;

And when I try the options..


gdb: unrecognized option `-g'
Use `gdb +help' for a complete list of options.

Rats.  Any other ideas?  Thanks..

paul

--



Fri, 21 Jun 1996 09:52:45 GMT  
 reading utmp



:>
:>It's also highly likely that the problem lies in that it doens't have a C
:>compiler that outputs stab information.  You should run it with trace mode
:>(-t) to see what it's actually doing.  You will likely have to use gcc on
:>an SGI machine, passing c2ph CC=gdb and DEFINES='-g -S -stabs', I believe.
:
:Here is the result of runnint it in trace mode...  and its only output..
:

:cat /usr/include/utmp.h > /tmp/c2ph.25640.c
:cd /tmp; cc -g -S  /tmp/c2ph.25640.c
:reading from /tmp/c2ph.25640.s: 2
:computing intrinsic sizes: done
:resolving types
:building type templates:
:dumping structs:
:
:1;
:
:
:And when I try the options..
:

:gdb: unrecognized option `-g'
:Use `gdb +help' for a complete list of options.
:
:
:Rats.  Any other ideas?  Thanks..

Blech.  CC=gcc, not gdb.  Sorry.

--tom
--

      "Will Hack Perl for Fine Food and Fun"
        Boulder Colorado  303-444-3212



Fri, 21 Jun 1996 11:09:54 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. perl and reading utmp

2. need perl script to read utmp files

3. Help: How to read utmp files properly?

4. reading utmp/wtmp

5. Reading /etc/utmp with perl.

6. /etc/utmp reading

7. how to read /var/adm/utmp using perl??????

8. How to get Idle Time from /etc/utmp?

9. utmp and wtmp...

10. Using SWIG to make a Perl module for accessing utmp/wtmp

11. Perl's open(F, "+>N"), seek, and utmp oddities

12. chat, talk and /etc/utmp

 

 
Powered by phpBB® Forum Software