From owner-freebsd-hackers Thu Sep 27 23:21:48 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from milliways.chance.ru (milliways.chance.ru [195.190.107.35]) by hub.freebsd.org (Postfix) with ESMTP id 6ECC037B40C for ; Thu, 27 Sep 2001 23:21:44 -0700 (PDT) Received: from do-labs.spb.ru (ppp-5.chance.ru [195.190.107.8]) by milliways.chance.ru (8.9.0/8.9.0) with SMTP id KAA08474 for ; Fri, 28 Sep 2001 10:21:35 +0400 (MSD) Received: (qmail 550 invoked by uid 1000); 27 Sep 2001 23:46:24 -0000 Date: Thu, 27 Sep 2001 23:46:24 +0000 From: Vladimir Dozen To: hackers@FreeBSD.org Subject: calling open() from inside kernel Message-ID: <20010927234624.A403@eix.do-labs.spb.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.4i 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 ehlo. I'm creating a patch to kernel that requires to create a set of files; names of files are generated inside kernel, i.e., strings belong to kernel address space. Initially, I tried to use open(), but failed with EFAULT: open() expects filename string is in userspace, and passes UIO_USERSPACE to NDINIT. Well, I copied a portion of code from kern/vfs_syscalls, and it works fine. But, the length and complexity of the code is too far beyond I could expect from such a basic operation as file opening, and all this just because single string is in wrong space. So, is there any way to call open() in simple way? Something like remapping string into curproc space, or telling open() that string is not in userspace, or smth else? Or, may be, I do something completely wrong? I'm new in kernel programming. -- dozen @ home To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message