DragonFly kernel List (threaded) for 2003-11
Re: anonymous storage and execve()
:I've spent the week trying to understand the source for execve() and the
:image activators. I think I'm ready to split execve(). Before I do,
:I have some questions about how I should allocate memory for the separate
:The string and image_header buffer is going to be split into a couple of
:pieces. For the strings, I need to create at least two buffers. One
:will be for the arg and env strings at least ARG_MAX in length. Another
:will be for the path name of the executable which should be PATH_MAX in
:In what cases should I be using the kmem allocator versus the slab
: David P. Reese, Jr. daver@xxxxxxxxxxxx
Normally you would always use the slab allocator but in this instance I
would change as little as possible so I would keep the
'img->stringbase = kmem_alloc...' code that is already there.
The uap being set in imgp is just used as temporary storage, I believe.
It looks like uap is mostly accessed at the beginning of execv() and
in exec_extract_strings() which is called near the beginning of the
What I recommend is that you create a new structure for imgp to point
to. e.g. instead of imgp->uap it would be imgp->xuap, and it would be
the job of the syscall code to construct this new structure, call the
kern_exec*() equivalent, and then free it.