Alfred Perlstein wrote:
>
> * Greg Lehey <[EMAIL PROTECTED]> [010712 21:08] wrote:
> > On Thursday, 12 July 2001 at 6:58:09 -0500, [EMAIL PROTECTED] wrote:
> > > Dear Friends
> > >
> > > I have some questions about kernel programming:
> >
> > You'd be better off sending mail like this to -hackers. I've followed
> > up there.
>
> I also got this in private mail, hrmm..
>
> > write() doesn't exist in the kernel. The simple answer is "you're
> > going to have to read what the send() syscall does and emulate it".
> > First, though, you need to answer the question "why do I want to do
> > this in the kernel?"
>
> it actually exists, however the problem is that copyin and friends
> assume a seperate address space, I wonder if one could do some trick
> to alias the seperate address space on top of the kernel, that should
> allow copyin and friends to work on pointers into the kernel's address
> space.
Such as looking at dofilewrite() which is what write() calls
internally. dofilewrite() fills up a struct uio and calls the
file descriptor's filesystem-dependent write routine. The
difference for writing from kernel would be using UIO_SYSSPACE
instead of UIO_USERSPACE when preparing the uio structure.
-SB
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message