From owner-freebsd-hackers Mon Jul 23 18:28:53 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 8AD9E37B401 for ; Mon, 23 Jul 2001 18:28:41 -0700 (PDT) (envelope-from arr@watson.org) Received: from localhost (arr@localhost) by fledge.watson.org (8.11.4/8.11.4) with SMTP id f6O1SOM56578; Mon, 23 Jul 2001 21:28:30 -0400 (EDT) (envelope-from arr@watson.org) Date: Mon, 23 Jul 2001 21:28:24 -0400 (EDT) From: "Andrew R. Reiter" To: rootx11@xfreek.mindriot.net Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: your mail In-Reply-To: <20010723194746.418.qmail@xfreek.mindriot.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On 23 Jul 2001 rootx11@xfreek.mindriot.net wrote: > > 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); #1 bad form calling syscalls like this within the kernel -- just doesnt make sense #2 open(2) will attempt to do a copyinstr rather than a copystr and that is not correct. > wstructure->buf = "Testing\n"; > wstructure->nbytes = 8; > return write(p, wstructure); > } > same idea with this write function and the buf parameter. > 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. ;-) While it's not the best, check out: http://www.daemonnews.org/200010/blueprints.html Andrew *-------------................................................. | Andrew R. Reiter | arr@fledge.watson.org | "It requires a very unusual mind | to undertake the analysis of the obvious" -- A.N. Whitehead To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message