Re: accept() improvements for rt signals

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Tue Feb 22 2000 - 12:26:11 EST


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).

enjoy,
-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:30 EST