Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!brl-adm!adm!willcox%mycroft@gswd-vms.arpa From: willcox%mycroft@gswd-vms.arpa Newsgroups: comp.unix.wizards Subject: Re: copyin Message-ID: <4887@brl-adm.ARPA> Date: Wed, 11-Mar-87 09:47:44 EST Article-I.D.: brl-adm.4887 Posted: Wed Mar 11 09:47:44 1987 Date-Received: Thu, 12-Mar-87 23:31:37 EST Sender: news@brl-adm.ARPA Lines: 25 I don't think that Ron Natalie has it quite right about where you can or must use copin/out. 1) No version of copyin/out that I've seen will work for other than the current process. In other words, you can't use it from interrupt code, nor to copy data to/from another process. 2) On lots of machines, the current process is mapped while you are processing a system call. However, one of the jobs of copyin/out even on these systems is to ensure that the user has legal access to the area of memory in question. They prevent the kernel from getting a segmentation fault and from copying over its own area when the user gives it a bogus pointer. For this reason, you MUST (a moral, if not physical requirement) use copyin/out (or fuword, uiomove on BSD, etc.) to access user space. If you have a case where you are sure that you can blindly use a pointer supplied from user space, then I can write a program that will crash your system. David A. Willcox Gould CSD-Urbana 1101 E. University Ave. Urbana, IL 61801 217-384-8500 UUCP: {decvax,ihnp4}!uiucdcs!ccvaxa!willcox ARPA: willcox@gswd-vms.arpa