From owner-freebsd-hackers Tue Jul 24 10:13:46 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.dis.org (sat.dis.org [216.240.44.14]) by hub.freebsd.org (Postfix) with ESMTP id 4CC7737B406 for ; Tue, 24 Jul 2001 10:13:34 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.4/8.11.3) with ESMTP id f6O0k0204188; Mon, 23 Jul 2001 17:46:00 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200107240046.f6O0k0204188@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: rootx11@xfreek.mindriot.net Cc: freebsd-hackers@freebsd.org In-reply-to: Your message of "23 Jul 2001 19:47:46 -0000." <20010723194746.418.qmail@xfreek.mindriot.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 23 Jul 2001 17:46:00 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Hello > I am experimenting with kernel modules and am trying to write to a file. > This is the syscall function (sorry of my terminology is messed up) > > static int write_file(struct proc *p, void *arg) { > struct write_args *wstructure; > struct open_args *ostructure; > > ostructure->path="/tmp/blehfile"; > ostructure->flags = O_CREAT; > ostructure->mode = 0; > wstructure->fd = open(p, ostructure); > wstructure->buf = "Testing\n"; > wstructure->nbytes = 8; > return write(p, wstructure); > } > > Im not sure why, but that code crashes. Was created with: > echo Hi > /tmp/blehfile. Also, is there an official freebsd kernel hackers > guide? Kernel programming is very interesting. ;-) Write expects the data to be in userspace; you can't call it from the kernel. (This is a bug.) -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message