syscall copy{in,out} separation

Matthew Dillon dillon at
Sat Aug 23 09:20:39 PDT 2003

    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.

					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>

:Here's a patch that attempts to separate copy{in,out} from the bind(),
:connect() and accept() syscalls.
: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 at xxxxxxxxxxxx

More information about the Submit mailing list