DragonFly BSD
DragonFly kernel List (threaded) for 2003-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: anonymous storage and execve()


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 7 Nov 2003 09:33:33 -0800 (PST)

: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
:buffers.
:
: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
:length.
:
:In what cases should I be using the kmem allocator versus the slab
:allocator?
:
:-- 
:   David P. Reese, Jr.                                     daver@xxxxxxxxxxxx
:                                               http://www.gomerbud.com/daver/

    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
    image activator.

    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.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]