[lkml]   [2000]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: accept() improvements for rt signals
Dan Kegel wrote:
> > int accept (int oldfd, struct sockaddr *, int *addrlen,
> > int newfd, pid_t sigpid, unsigned int clone_flags)
> >
> > newfd will be the fd we use for the new socket (with precisely the same
> > semantics as dup2); sigpid will be the pid to which we grant ownership
> > of the new socket (allowing us to load-balance between threads); and
> > clone_flags will be a bitmap indicating what properties of the original
> > socket we want to copy to the new one, including the obvious ones:
> Just to be clear, the "original socket" here is the listening socket,
> right?
> Since newfd may already have been closed, presumably it's lost all of its
> properties, and can't be the "original socket".

newfd need not be closed, just shut down. This way you save a close()
syscall :-)

That's not necessary for fd recycling to work though. Closing is fine
for that.

But see my other message for why inheriting properties from the parent
socket might be more appropriate, at least for TCP options. (Signal
number and pid are obviously better not inherited from the parent socket).

-- Jamie

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:56    [W:0.104 / U:0.020 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site