copyin

chris at mimsy.UUCP chris at mimsy.UUCP
Thu Mar 12 18:52:13 AEST 1987


In article <157 at twg-ap.UUCP> narayan at twg-ap.UUCP (Narayan Mohanram) writes:
>... if you go to some other machine where it is not possible to
>distinguish between kernel space and user space, ... you may crash
>and burn.

Right.

>You really need to to do a uchar(I think) not a copy in to load the
>string in (after setting u.u_xxx).

No: namei used to call uchar to read from user I or D space, one
byte at a time.  One would set u.u_segflg according to the source
space (user instruction, user data, or system), and namei and a
few other routines would call uchar or schar.  I am not old enough
to be familiar with just which routines were done which way in
which kernels, but in 4.3, the routine to copy strings in is
`copyinstr'.  Incidentally, the 4.3 copy routines have been adapted
to 2.10BSD, speeding it considerably.  A function call per character
for every name lookup is just a bit too much overhead.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690)
UUCP:	seismo!mimsy!chris	ARPA/CSNet:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list