From owner-freebsd-hackers Thu Feb 11 11:10:40 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA01859 for freebsd-hackers-outgoing; Thu, 11 Feb 1999 11:10:40 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from csgrad.cs.vt.edu (csgrad.cs.vt.edu [128.173.41.41]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA01842 for ; Thu, 11 Feb 1999 11:10:36 -0800 (PST) (envelope-from mhabib@vt.edu) Received: from bindgrass (bindgrass.cs.vt.edu [128.173.41.121]) by csgrad.cs.vt.edu (8.9.1a/8.9.1) with SMTP id OAA17945 for ; Thu, 11 Feb 1999 14:10:29 -0500 (EST) Message-Id: <3.0.5.32.19990211140756.0090e4f0@csgrad.cs.vt.edu> X-Sender: palash@csgrad.cs.vt.edu X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.5 (32) Date: Thu, 11 Feb 1999 14:07:56 -0500 To: freebsd-hackers@FreeBSD.ORG From: "Md. Ahsan Habib" Subject: /dev/kmem Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi I am facing some problems to use /dev/kmem. I tried a lot, post it to the news groups but couldn't come up to a solution. In one of my experiments I need to write in /dev/kmem. I can't use normal file because it will consume more time which will affect my experiments. This is a sample code I tried to execute: #include #include #include extern int errno; int main() { int fp,w,c; long l; char * Buff = "1234"; fp = open("/dev/kmem", O_RDWR); if (fp == -1) { printf("open returned error\n"); perror("open"); } l = lseek(fp, 0x000a000,0); w = write(fp,Buff,4); c = close(fp); return 0; } It can open the file, change the file pointer, close the file but can't write anything in the file. The value of w is always -1. I tried with several locations instead of the beginning one 0x000a000. I set all necessary mod and ownership. I will be happy if anyone can help me. It's really important to me. Sincerely, --Ahsan Habib Department of Computer Science Virginia Tech. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message