Subject: Re: curproc removal (NFS, ...)
To: YAMAMOTO Takashi <>
From: Jonathan Stone <>
List: tech-kern
Date: 06/04/2004 12:04:53
nIn message <>,
YAMAMOTO Takashi  writes:

>> We have agreed not to go back to using use curproc.  How, then, would
>> you suggest we pass the necessary struct proc * to soreceive(), so it
>> can pass it onto pr->pr_domain->dom_externalize?
>for UIO_USERSPACE requests, i think it's fine to use uio_procp for
>in the case of SYSSPACE, it's better to return EINVAL (or panic?), IMO.


Thank you, thats a fair answer. But I think we are still talking at
cross-purposes. The case I am most interested in is when soreceive()
is passed a non-NULL struct mbuf **mp argument.  The source comment
says for that case, only the count in uio_resid field is actually used.

Several of the callers which pass soreceive a struct mbuf ** don't
even set the uio_segflag. Heck, before the changes I commited last
month, there was at least one call where the values of both
uio_segflag and uio_procp passing were uninitalized garbage from prior
on-stack contents.

I guess the cleanest way to fix this is to add a new UIO segflag,
UIO_NONE, meaning that only uio_resid is valid; and also uio_procp, if
its value is non-NULL, but a NULL value is allowed).  Do you buy that?

Jason?  Matt?  Anyone else have an opinion?