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

Re: syscall copy{in,out} separation


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 23 Aug 2003 09:18:58 -0700 (PDT)

    This looks really good.  I think you do have to use dynamic allocation
    for accept*(), what you have now will crash the system :-) because
    the namelen set by userland may be larger then the locally declared
    sockaddr in accept().  I think it is acceptable to have accept1()
    return the sockaddr allocated by soaccept() and then have accept()
    FREE it.

    If you would like to make that change and post another patch set I will
    do a final run through, test, and commit it!

    p.s. this type of syscall separation work will allow us to completely
    throw away all the stackgap() nonsense in the emulation code.  Even
    though the emulation code will eventually be moved to userland this is a
    good example of a case where we we still need to keep things clean and
    in synch even though we might completely rewrite parts of it later on.

					-Matt
					Matthew Dillon 
					<dillon@xxxxxxxxxxxxx>

:Here's a patch that attempts to separate copy{in,out} from the bind(),
:connect() and accept() syscalls.
:
:http://gomerbud.com/daver/patches/dragonfly/syscall-separation-1.diff
:
:Would it be benificial to further modify accept() to use dynamic allocation
:for the sockaddr?  The structure isn't really that big.
:
:Also, if accept1() instead took a handle to the sockaddr, it would be
:possible to copyout the sockaddr returned by soaccept() and FREE() it
:without any allocatons happening in accept().  This would be similar to
:the way that getsockaddr() works.
:
:-- 
:   David P. Reese, Jr.                                     daver@xxxxxxxxxxxx




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