|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 1170 (0x492)
Types: TextFile
Names: »readstatus.c«
└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
└─⟦this⟧ »EUUGD11/euug-87hel/sec8/sps/readstatus.c«
# include "sps.h"
# include <h/text.h>
/* READSTATUS - Reads the kernel memory for current processes and texts */
readstatus ( process, text )
register struct process *process ;
struct text *text ;
{
register struct proc *p ;
register struct proc *p0 ;
register struct process *pr ;
extern struct info Info ;
extern int Flkmem ;
char *getcore() ;
/* Read current text information */
memseek( Flkmem, (long)Info.i_text0 ) ;
if ( read( Flkmem, (char*)text, Info.i_ntext * sizeof( struct text ) )
!= Info.i_ntext * sizeof( struct text ) )
prexit( "sps - Can't read system text table\n" ) ;
/* Read current process information */
p0 = (struct proc*)getcore( sizeof( struct proc )*Info.i_nproc ) ;
memseek( Flkmem, (long)Info.i_proc0 ) ;
if ( read( Flkmem, (char*)p0, Info.i_nproc * sizeof( struct proc ) )
!= Info.i_nproc * sizeof( struct proc ) )
prexit( "sps - Can't read system process table\n" ) ;
/* Copy process information into our own array */
for ( p = p0, pr = process ; pr < &process[ Info.i_nproc ] ; p++, pr++ )
pr->pr_p = *p ;
free( (char*)p0 ) ;
}