DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T k

⟦48ef07d63⟧ TextFile

    Length: 734 (0x2de)
    Types: TextFile
    Names: »kmem.c«

Derivation

└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦697af93db⟧ »EurOpenD3/network/snmp/mit-snmp.tar.Z« 
        └─⟦57bbcbe75⟧ 
            └─⟦this⟧ »./bsd/kmem.c« 
└─⟦9ae75bfbd⟧ Bits:30007242 EUUGD3: Starter Kit
    └─⟦925ee6880⟧ »EurOpenD3/network/snmp/mit-snmp.900225.tar.Z« 
        └─⟦a4bfa469c⟧ 
            └─⟦this⟧ »./bsd/kmem.c« 

TextFile


/*
 *	$Header: kmem.c,v 1.1 89/01/11 22:10:41 jrd Exp $
 *	Author: J. Davin
 *	Copyright 1988, 1989, Massachusetts Institute of Technology
 *	See permission and disclaimer notice in file "notice.h"
 */

#include	<notice.h>


#include	<ctypes.h>
#include	<debug.h>

#include	<stdio.h>
#include	<sys/types.h>
#include	<sys/file.h>

static		int		kmemFd;

CVoidType		kmemInit ()

{
	if ((kmemFd = open ("/dev/kmem", O_RDONLY, 0)) == -1) {
		perror ("kmemInit");
	}
}

CIntfType		kmemRead (bp, n, addr)

CBytePtrType		bp;
CIntfType		n;
CUnslType		addr;

{
	off_t			lseek ();

	if (lseek (kmemFd, (off_t) addr, L_SET) == (off_t) -1) {
		return ((CIntfType) -1);
	}
	else {
		return ((CIntfType) read (kmemFd, (char *) bp, (int) n));
	}
}