Date: Thu, 27 Sep 2001 23:46:24 +0000 From: Vladimir Dozen <vladimir-dozen@mail.ru> To: hackers@FreeBSD.org Subject: calling open() from inside kernel Message-ID: <20010927234624.A403@eix.do-labs.spb.ru>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010927234624.A403>