From owner-freebsd-hackers Thu Jul 12 23:32: 2 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id 3717D37B401 for ; Thu, 12 Jul 2001 23:31:57 -0700 (PDT) (envelope-from vel@bugz.infotecs.ru) Received: (from root@localhost) by bugz.infotecs.ru (8.11.1/8.11.1) id f6D6kPR01837 for freebsd-hackers@freebsd.org; Fri, 13 Jul 2001 10:46:25 +0400 (MSD) (envelope-from vel) From: "Eugene L. Vorokov" Message-Id: <200107130646.f6D6kPR01837@bugz.infotecs.ru> Subject: Re: Some questions about kernel programming In-Reply-To: <20010712212809.F6664@sneakerz.org> "from Alfred Perlstein at Jul 12, 2001 09:28:09 pm" To: freebsd-hackers@freebsd.org Date: Fri, 13 Jul 2001 10:46:25 +0400 (MSD) X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 Forgot to Cc: here: > You can't call kernel strlen on a userland address, you must do > something like this: How so ? It seems to work for me. For instance, I used userland address space buffer to simulate __getcwd() syscall on the current process (I was hacking open() syscall and log full path of the file to the syslog). I simulate mmap() with MAP_ANON and fd == -1 on that process, then I do __getcwd() to the buffer allocated, and then I'm very well able to call strlen() on that userland buffer, as well as other str* functions. So generally I think it works. Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message